summaryrefslogtreecommitdiff
path: root/.maildirproc/purdue.rc
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-01-27 17:20:28 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-01-27 17:33:31 -0500
commita40e1c62cb734c86f242eae61301791611cd3085 (patch)
treeb74cc4be011bc1c83fb80d9b27e1f45c727fca8f /.maildirproc/purdue.rc
parent8428506f9fb9a71b555dd15a158282c90bf77220 (diff)
symlink a bunch of things into .config
Diffstat (limited to '.maildirproc/purdue.rc')
-rw-r--r--.maildirproc/purdue.rc84
1 files changed, 0 insertions, 84 deletions
diff --git a/.maildirproc/purdue.rc b/.maildirproc/purdue.rc
deleted file mode 100644
index 9a759f5..0000000
--- a/.maildirproc/purdue.rc
+++ /dev/null
@@ -1,84 +0,0 @@
-# -*- mode: python; -*-
-
-import subprocess
-
-processor.maildir_base = "~/Maildir.purdue"
-processor.auto_reload_rcfile = True
-
-def is_to_or_from(mail,address):
- """
- Return true if [mail] is to or from an address that contains [address].
- """
- return (
- mail["From"].contains(address)
- or mail.target.contains(address))
-def is_to_or_from_re(mail,address):
- """
- Return true if [mail] is to or from an address that matches the
- regex [address].
- """
- return (
- mail["From"].matches(address)
- or mail.target.matches(address))
-
-def piazza_topic(mail, topic):
- return (
- is_to_or_from(mail, topic+" on Piazza")
- or mail["Subject"].contains(topic+" on Piazza"))
-
-def my_filters(mail):
- # Generic stuff ########################################################
-
- if mail["Subject"].contains("[PASE]"):
- mail.move("INBOX.PASE")
- return
-
- if mail["Subject"].contains("[PLUG]"):
- mail.move("INBOX.PLUG")
- return
-
- if is_to_or_from(mail,"linkedin.com"):
- mail.move("INBOX.LinkedIn")
- return
-
- if (
- False
- or mail["Subject"].contains("[CS Opportunity Update]")
- or mail["Subject"].contains("[CS Majors]")
- ):
- mail.move("INBOX.CS")
- return
-
- # Fall 2012 ############################################################
-
- if mail["Subject"].contains("Fall-2012-SCI-21000-001:"):
- mail.move("INBOX.classes.2012-2.SCI210")
- if mail["Subject"].contains("fall-2012-cs-18000"):
- mail.move("INBOX.classes.2012-2.CS180")
- return
- if piazza_topic(mail, "CS 18000"):
- mail.move("INBOX.classes.2012-2.CS180.Piazza")
- return
- if mail["Subject"].contains("Fall-2012-SOC-10000"):
- mail.move("INBOX.classes.2012-2.SOC100")
- return
-
- # Spring 2013 ##########################################################
-
- 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"].contains("Spring-2013-CS-18200"):
- mail.move("INBOX.classes.2013-1.CS182")
- return
-
-handle_mapping = {
- "INBOX": my_filters,
- }
-processor.maildirs = handle_mapping.keys()
-for mail in processor:
- handle_mapping[mail.maildir](mail)