diff options
Diffstat (limited to '.config/maildirproc')
-rw-r--r-- | .config/maildirproc/att.rc (renamed from .config/maildirproc/default.rc) | 28 | ||||
-rw-r--r-- | .config/maildirproc/purdue.rc | 77 |
2 files changed, 96 insertions, 9 deletions
diff --git a/.config/maildirproc/default.rc b/.config/maildirproc/att.rc index ecea80f..e862b3f 100644 --- a/.config/maildirproc/default.rc +++ b/.config/maildirproc/att.rc @@ -1,9 +1,11 @@ -# -*- mode: python; -*- +# -*- mode: python; indent-tabs-mode: t -*- +import os import subprocess processor.maildir_base = "~/Maildir" processor.auto_reload_rcfile = True +processor.logfile = os.getenv('XDG_CACHE_HOME', "~/.cache")+"/maildirproc/att.log" def is_to_or_from(mail,address): """ @@ -78,7 +80,7 @@ def my_filters(mail): if ( False or mail["List-Id"].matches(list+"\.gnu\.org") - or mail["Subject"].contains(list) + or mail["Subject"].contains('['+list+']') ): mail.move(".software."+list) return @@ -97,14 +99,31 @@ def my_filters(mail): return if mail["List-Id"].matches("maintenance.lists.parabolagnulinux.org"): + if mail["From"].contains("monit@"): + if mail["Message-Id"].contains("@repo.parabolagnulinux.org"): + mail.move(".software.parabola-maintenance.monit-repo") + return + if mail["Message-Id"].contains("@rshg054.dnsready.net"): + mail.move(".software.parabola-maintenance.monit-rshg054") + return + if mail["Subject"].matches("Cron <.*@repo>"): + mail.move(".software.parabola-maintenance.cron-repo") + return + if mail["Subject"].matches("Cron <.*@rshg054>"): + mail.move(".software.parabola-maintenance.cron-rshg054") + return mail.move(".software.parabola-maintenance") return + + if is_to_or_from(mail, "parabola.nu"): + mail.move(".software.parabola-labs") + return + if ( False or mail["List-Id"].matches("parabolagnulinux.org") or is_to_or_from(mail, "parabolagnulinux.org") or is_to_or_from(mail, "kiwwwi.com.ar") - or is_to_or_from(mail, "parabola.nu") ): mail.move(".software.parabola-dev") return @@ -175,7 +194,7 @@ def my_filters(mail): "parsonstjade@gmail.com", "jadparso@umail.iu.edu", ]: - if mail["From"].contains(address): + if is_to_or_from(mail,address): mail.move(".misc.Jade") return @@ -221,7 +240,6 @@ def my_filters(mail): mail.move(".School.Robotics") return for subject_re in [ - "FIRST", "robotics", "1024", "kil-?a-?bytes", diff --git a/.config/maildirproc/purdue.rc b/.config/maildirproc/purdue.rc index 9a759f5..0ffc1e6 100644 --- a/.config/maildirproc/purdue.rc +++ b/.config/maildirproc/purdue.rc @@ -1,9 +1,11 @@ -# -*- mode: python; -*- +# -*- mode: python; indent-tabs-mode: t -*- +import os import subprocess processor.maildir_base = "~/Maildir.purdue" processor.auto_reload_rcfile = True +processor.logfile = os.getenv('XDG_CACHE_HOME', "~/.cache")+"/maildirproc/purdue.log" def is_to_or_from(mail,address): """ @@ -29,7 +31,12 @@ def piazza_topic(mail, topic): def my_filters(mail): # Generic stuff ######################################################## - if mail["Subject"].contains("[PASE]"): + if ( + False + or mail["Subject"].contains("[PASE]") + or is_to_or_from(mail,"Purduealumni@purdue.edu") + or is_to_or_from(mail,"pase@purdue.edu") + ): mail.move("INBOX.PASE") return @@ -37,12 +44,45 @@ def my_filters(mail): mail.move("INBOX.PLUG") return + if mail["From"].matches(".*bursar.*@purdue\.edu"): + mail.move("INBOX.tuition") + return + + if mail["From"].contains("mailhub-admin@purdue.edu"): + mail.move("INBOX.mailhub-admin") + return + + if mail["From"].matches("pmx-.*@purdue.edu"): + mail.move("INBOX.spam") + return + if is_to_or_from(mail,"linkedin.com"): mail.move("INBOX.LinkedIn") return if ( False + or is_to_or_from(mail,"@edrtrust.com") + or is_to_or_from(mail,"@propertysolutions.com") + or is_to_or_from(mail,"collegestationapartments@gmail.com") + ): + mail.move("INBOX.CollegeStation") + return + + if mail["From"].matches("facebook(|mail)\.com"): + mail.move("INBOX.Facebook") + return + + if ( + False + or is_to_or_from(mail,"@cable.comcast.com") + or is_to_or_from(mail,"@apexsystemsinc.com") + ): + mail.move("INBOX.Comcast") + return + + if ( + False or mail["Subject"].contains("[CS Opportunity Update]") or mail["Subject"].contains("[CS Majors]") ): @@ -65,15 +105,44 @@ def my_filters(mail): # Spring 2013 ########################################################## + if mail["Subject"].contains("[CS240] Submission result for"): + mail.move("INBOX.classes.2013-1.CS240.autograder") + return if mail["Subject"].contains("[CS240]") or mail["Subject"].contains("Spring-2013-CS-24000"): mail.move("INBOX.classes.2013-1.CS240") return if piazza_topic(mail, "CS 240"): mail.move("INBOX.classes.2013-1.CS240.Piazza") return + if mail["Subject"].matches(".*(PHYS|CHIP)\s*220.*") or is_to_or_from(mail,"srdas@purdue.edu"): + mail.move("INBOX.classes.2013-1.PHYS220") + return + if mail["Subject"].contains("Spring-2013-SOC-22000"): + mail.move("INBOX.classes.2013-1.SOC220") + return - if mail["Subject"].contains("Spring-2013-CS-18200"): - mail.move("INBOX.classes.2013-1.CS182") + # Fall 2013 ############################################################ + + if mail["Subject"].contains("Fall-2013-CS-25000"): + mail.move("INBOX.classes.2013-2.CS250") + return + if piazza_topic(mail, "CS 250") or piazza_topic(mail, "CS 250-FALL2013"): + mail.move("INBOX.classes.2013-2.CS250.Piazza") + return + if mail["Subject"].contains("Fall-2013-CS-25100"): + mail.move("INBOX.classes.2013-2.CS251") + return + if piazza_topic(mail, "CS 251"): + mail.move("INBOX.classes.2013-2.CS251.Piazza") + return + if mail["Subject"].contains("Fall-2013-SPAN-10100"): + mail.move("INBOX.classes.2013-2.SPAN101") + return + if mail["Subject"].contains("Fall-2013-MA-26100"): + mail.move("INBOX.classes.2013-2.MA261") + return + if mail["Subject"].contains("Fall-2013-MA-26500"): + mail.move("INBOX.classes.2013-2.MA265") return handle_mapping = { |