Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Mail::IMAPClient Time Zoneby tirwhan (Abbot) |
on Mar 13, 2009 at 14:03 UTC ( [id://750420]=note: print w/replies, xml ) | Need Help?? |
Mail::IMAPClients "on" function has very little to do with the Date header inside the emails. "on" uses the IMAP "ON" search argument, which searches for messages by the internal date, i.e. the time at which it was received by the server. To list messages by the date they were sent (which is what the Date: header specifies) you'll need to search using "senton".
Update: Reading up the relevant RFCs, I find that what I wrote in the stricken-out section is wrong. IMAP4rev1 does not permit inclusion of time or time zone in ON and SENTON searches (this is clarified in RFC 3501). So searching with these methods will always only take into account the date section of the relevant entry (either "Date:" or "internal date"). It seems what you want cannot be done with IMAP and you need to sort mail client-side (though formally, SENTON will retrieve all mails with the Date: header of a certain day, this is just completely irrespective of your clients time zone). All dogma is stupid.
In Section
Seekers of Perl Wisdom
|
|