Having issues getting IMAP to work right in a Trigger Event

so i know for a while now my hotmail doesnt work for imap anymore and i wanted to get back to using it for like deliveries

so i set up my hotmail account to forward the email to my gmail account…

and i also setup my imap gmail… and it works says i got like 7500 emails but they not all emails they just promotion and all that other crap you get…

so that part works

but the sensor part isnt working
ive tried these 2 ways and i only getting unknown

- trigger:
    - trigger: event
      event_type: "imap_content"
      id: "Fedex Delivery Content"
      event_data:
        sender: "[email protected]"
        intial: true
        #sender: "[email protected]"
  sensor:
    - name: Fedex Delivery
      state: >-
        {% if 'Your package has been received!' in trigger.event.data["subject"] %}
          received
        {% elif 'Your package has been delivered!' in trigger.event.data["subject"] %}
          delivered
        {% elif 'Your order has been delivered!' in trigger.event.data["subject"] %}
          delivered
        {% elif 'shipment is on the way' in trigger.event.data["subject"] %}
          on_the_way
        {% elif 'Your package is now out for delivery today' in trigger.event.data["subject"] %}
          out_for_delivery          
        {% endif %}

- trigger:
    - trigger: event
      event_type: "imap_content"
      id: "mike Emailed"
      event_data:
        sender: "[email protected]"
  sensor:
    - name: mike Emailed2
      state: "{{ trigger.event.data['sender'] }}"

now the email i forwarded from Fedex is the subject is

Fw: Your shipment is on the way 

now id like to be able to search in the email if its Fedex or UPS etc as it only forwards the title and i cant search for the email address

but i cant seem to get it to work…what i doing wrong its been a year since i used the IMAP when hotmail stopped working so i been out of using it i looked at the examples and seems ok but something not working

so in the time of writing all this the 2nd part worked on its own

the
sensor.mike_emailed2 returns the value of [email protected]
but the other sensor is still not returning the state its still unknown

i tried this and i still get uknown it doesnt seem to like the subject

- trigger:
    - trigger: event
      event_type: "imap_content"
      id: "mike Emailed3"
      event_data:
        sender: "[email protected]"
  sensor:
    - name: mike Emailed3
      state: "{{ trigger.event.data['subject'] }}"

so i kinda got text search to work i had to enable Message Body in the imap intergration…

i now trying to search for Text in the message and Subject line… but it doesnt work how do you code it? as i wanna do it also for UPS and Intelcom

- trigger:
    - trigger: event
      event_type: "imap_content"
      id: "Mike Delivery Content4"
      event_data:
        sender: "[email protected]"
        #intial: true
        #sender: "[email protected]"
  sensor:
    - name: Mikes Delivery4
      state: >-
        {% if 'FedEx' in trigger.event.data["text"] %}
          {% if 'We have your shipment' in trigger.event.data["subject"] %}
            received
          {% elif 'Your package has been delivered!' in trigger.event.data["subject"] %}
            delivered
          {% elif 'Your order has been delivered!' in trigger.event.data["subject"] %}
            delivered
          {% elif 'Fw: Your shipment is on the way' in trigger.event.data["subject"] %}
            on_the_way_testing
          {% elif 'Your shipment is out for delivery today' in trigger.event.data["subject"] %}
            out_for_delivery          
          {% endif %}
        {% elif 'UPS' in trigger.event.data["text"] %}
        {% elif 'Intelcom' in trigger.event.data["text"] %}
        {% endif %}

Have you considered setting up a Redirect rule in Hotmail instead of forwarding? Doing so will leave the original data intact, so that it is accessible in the event data.

no i didnt know of something like that… i can google that
i take it by doing 2 conditions for Message and Subject is alot harder to do? or not possible?
but ill look it up

will the redirect rule also allow to keep the orginal email on my hotmail as i use it for organizing but if it can redirect and leave a copy then i guess that would work too

apparently i cant do get through the forwarding option… in hotmail when i choose forwarding, and tells me to re login to use it… i get the error too many requests…
which i dunno so far i just been practicing by manually forwarding the email from my hotmail to gmail…
ill have to re try later maybe its down or something

Yes, the original is left in the inbox.

I don’t know what you are trying to say here.

The option to redirect is in the “Rules” section of Hotmail/Outlook’s settings not “Forwarding and IMAP”.

what i ment was i cant get through the forwading option is … when you click forwarding… it tells you to sign in … well you cant … its spitting the error “too many requests” so unable to do that for the time being till microsoft fixes it or what not