Ok, I am trying to modify some code given to me by the author of the dspam plugin for dovecot (sorry the name eludes me). I am modifying it to handle UNSEEN differently than SEEN. Below is the python code. I am not a python programmer, but I get the basic idea. ok, uids = conn.search(None, 'BEFORE', unreadsentbefore, 'SEEN') "11-May-2007 06:18:29 -0600" is the value of unreadsentbefore. However, this doesn't match any emails even though they are all dated as 5/10 and they have all been read for several hours (the time was the current to figure out why it isn't working). Is there a problem with BEFORE and SEEN together? Is there a BEFORE bug in the system? Some of the messages are -500 and others, I am not sure. Thanks, Trever Adams
On Fri, 2007-05-11 at 06:22 -0600, Trever L. Adams wrote:> > ok, uids = conn.search(None, 'BEFORE', unreadsentbefore, 'SEEN') > > "11-May-2007 06:18:29 -0600" is the value of unreadsentbefore.From IMAP RFC: search-key = "ALL" / "ANSWERED" / "BCC" SP astring / "BEFORE" SP date / "BODY" SP astring / .. date = date-text / DQUOTE date-text DQUOTE date-text = date-day "-" date-month "-" date-year So you'll need to use "11-May-2007". It doesn't support time. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070511/0d2f8f35/attachment.bin>
Timo Sirainen wrote:> From IMAP RFC: > > search-key = "ALL" / "ANSWERED" / "BCC" SP astring / > "BEFORE" SP date / "BODY" SP astring / > .. > date = date-text / DQUOTE date-text DQUOTE > date-text = date-day "-" date-month "-" date-year > > So you'll need to use "11-May-2007". It doesn't support time. >Tim, thank you. I am afraid I do not understand if the date is only allowed as such why does python's imaplib convert the date as such?!? Anyway, I understand that is a question for some place else. I hope python has something like strtok or similar where I can tokenize the first part out to be used. Thank you very much. Trever