# -*- python -*- # # This maildirproc program checks each mail in the scanned maildirs # and moves mail according to the X-Spam-Status header. # # maildirproc could be run like this: # # maildirproc -r simple.rc -b ~/Maildir -m . for mail in processor: if mail["X-Spam-Status"].matches("^Yes"): mail.move(".Spam") else: mail.move(".Other")