#IMAP Search Commands - Today

1 messages · Page 1 of 1 (latest)

crystal iris
#

I'm wondering if it's possible to pass a date parameter to the IMAP configuration so that it only looks at email from today. I see there are Search commands available like "SINCE <date>" and "ON <date>".
I'm trying to monitor for email that comes once a day (postal service indicating mail has been delivered).
Since this comes into my email, it's possible it will be seen before the imap configuration sees it so I'm trying to figure out how to check all of today's email to see if it's arrived vs the default "UnSeen UnDeleted"
Edit to add: This is a gmail account and I can use the Gmail Imap Extensions as well, but I'm not seeing how to do it there, either"

#

I think I found something that will work. Using Gmail : X-GM-RAW "in:inbox newer_than:16h"

#

For my use I'll actually use newer than 8h since the sensor gets reset after 8 hours.

crystal iris
#

Okay, while I thought that would work, I still only see the latest mail show up when I listen to the imap_content event.

#

The count is correct for the state of the imap messages, so it's pulling the data correctly, bit it's not triggering the custom template for changing the state on a binary sensor based on the subject of an email from a specific sender being in those messages