imapfilter Python hack to perform various filtering (like spam handling) on an IMAP mailbox. My normal setup used this to run spam assassin to do spam filtering.