diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-05-17 22:28:56 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-05-17 22:28:56 -0400 |
commit | 8e5ee10f6fe9f9a756b4530091e05adea7eb6f51 (patch) | |
tree | 34683d68ca25fbbf7e4bff414aff80529cbdd801 | |
parent | 4ad3f4c6e79ac33813474c171314b8432466b1ef (diff) |
tweak maildirproc filters to do fewer writes
-rw-r--r-- | .maildirproc/default.rc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/.maildirproc/default.rc b/.maildirproc/default.rc index d7351c5..1661527 100644 --- a/.maildirproc/default.rc +++ b/.maildirproc/default.rc @@ -46,24 +46,25 @@ def handle_incoming_spam_training(mail): def handle_incoming_ham_training(mail): bogofilter_ham(mail) - mail.move(".Ham") + handle_incoming_ham(mail) def handle_incoming_ham(mail): my_filters(mail) +def handle_incoming_spam(mail): + mail.move(".Bulk Mail") def handle_incoming_unknown(mail): # Filter spam spam = bogofilter_auto(mail) if spam == 0: - mail.move(".Bulk Mail") + handle_incoming_spam(mail) return elif spam == 1: - mail.move(".Ham") + handle_incoming_ham(mail) return elif spam == 2: # maybe spam - my_filters(mail) return else: mail.move(".Error") @@ -318,11 +319,13 @@ def my_filters(mail): mail.move(".misc.accounts") return + mail.move(".Ham") + handle_mapping = { ".": handle_incoming_unknown, ".spam-training": handle_incoming_spam_training, ".ham-training": handle_incoming_ham_training, - ".Ham": handle_incoming_ham, + #".Ham": handle_incoming_ham, } processor.maildirs = handle_mapping.keys() for mail in processor: |