This is a patch which changes python's mailbox.Maildir class to move processed messages form new/ to cur/. Although not expicity stated in http://cr.yp.to/proto/maildir.html all applications using Maildirs I'm aware of move messages form new/ to cur/ after the first reading of a message. This patch creates the same behaviour in python. --drt@un.bewaff.net - http://c0re.jp/ --- Lib-orig/mailbox.py Sat Sep 29 13:03:12 2001 +++ Lib/mailbox.py Sat Sep 29 13:01:38 2001 @@ -201,7 +201,8 @@ class Maildir: - # Qmail directory mailbox + # qmail/maildrop directory mailbox + # see http://cr.yp.to/proto/maildir.html def __init__(self, dirname, factory=rfc822.Message): self.dirname = dirname @@ -225,6 +226,10 @@ fn = self.boxes[0] del self.boxes[0] fp = open(fn) + # if the message is considered new, mark it as seen + (head, tail) = os.path.split(fn) + if(head[-3:] == 'new'): + os.rename(fn, os.path.join(head[:-3], 'cur', tail + ':2,S')) return self.factory(fp)