Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve IMAP email based on date AND time?

Tags:

date

time

imap

I'm trying to retrieve email using IMAP that's less than a certain number of hours old. I've looked over the specifications, and there is a SINCE method that accepts an RFC date. However, it ignores the time and timezone. Is there another method I can use to retrieve email based on date as well as time? Thanks

like image 939
Joe Lyga Avatar asked Jun 30 '11 20:06

Joe Lyga


1 Answers

RFC 5032 documents the WITHIN extension which introduces the search keyword YOUNGER, which is what you're looking for.

For example, to search for all emails less than 2 hours old:

a SEARCH YOUNGER 7200
like image 64
Celada Avatar answered Nov 16 '22 12:11

Celada