summaryrefslogtreecommitdiff
path: root/.config/maildirproc/att.rc
diff options
context:
space:
mode:
Diffstat (limited to '.config/maildirproc/att.rc')
-rw-r--r--.config/maildirproc/att.rc102
1 files changed, 45 insertions, 57 deletions
diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc
index 0252c74..e7f581b 100644
--- a/.config/maildirproc/att.rc
+++ b/.config/maildirproc/att.rc
@@ -37,20 +37,17 @@ def bogofilter_auto(mail):
"Error running bogofilter: Return code = {0!r}".format(
p.returncode))
return p.returncode
-
def bogofilter_ham(mail):
subprocess.call(["bogofilter", "-S", "-n", "-I", mail.path])
-
def bogofilter_spam(mail):
subprocess.call(["bogofilter", "-N", "-s", "-I", mail.path])
-def handle_incoming_spam_training(mail):
- bogofilter_spam(mail)
- mail.move("FOLDERS.Spam")
-
def handle_incoming_ham_training(mail):
bogofilter_ham(mail)
handle_incoming_ham(mail)
+def handle_incoming_spam_training(mail):
+ bogofilter_spam(mail)
+ mail.move("FOLDERS.Spam")
def handle_incoming_ham(mail):
my_filters(mail)
@@ -71,7 +68,7 @@ def handle_incoming_unknown(mail):
or mail["From"].contains("@parabola.nu")
or mail["From"].contains("parabolagnulinux.org")
or mail["From"].contains("@facebookmail.com>")
- or mail["List-Id"].matches(".*\.(gnu|archlinux|parabolagnulinuxlibre)\.org")
+ or mail["List-Id"].matches(".*\.(gnu|gnome|archlinux|parabolagnulinuxlibre)\.org")
):
handle_incoming_ham_training(mail)
return
@@ -84,10 +81,10 @@ def handle_incoming_unknown(mail):
handle_incoming_ham(mail)
return
elif spam == 2:
- mail.move("Inbox")
+ mail.move("FOLDERS.MysteryMeat")
return
else:
- mail.move("FOLDERS.Error")
+ mail.move("FOLDERS.BogoFail")
return
def my_filters(mail):
@@ -98,7 +95,7 @@ def my_filters(mail):
or mail["List-Id"].matches(list+"\.gnu\.org")
or mail["Subject"].contains('['+list+']')
):
- mail.move("FOLDERS.software."+list)
+ mail.move("FOLDERS.Ham.software."+list)
return
# Sort mail from other software mailing lists
@@ -107,67 +104,58 @@ def my_filters(mail):
or mail["List-Id"].matches("social-discuss\.gnu\.org")
or mail["Subject"].contains("social-discuss")
):
- mail.move("FOLDERS.software.social")
+ mail.move("FOLDERS.Ham.software.social")
return
if mail["List-Id"].matches("networkmanager-list\.gnome\.org"):
- mail.move("FOLDERS.software.networkmanager")
+ mail.move("FOLDERS.Ham.software.networkmanager")
return
if mail["List-Id"].matches("maintenance.lists.parabolagnulinux.org"):
- if mail["From"].contains("monit@"):
- if mail["Message-Id"].contains("@repo.parabolagnulinux.org"):
- if mail["Subject"].matches("^\[Maintenance\] monit alert -- (Execution|Connection) (succeeded|failed) sshd$"):
- mail.move("FOLDERS.software.parabola-maintenance.monit-repo.sshd")
- return
- mail.move("FOLDERS.software.parabola-maintenance.monit-repo")
- return
- if mail["Message-Id"].contains("@rshg054.dnsready.net"):
- mail.move("FOLDERS.software.parabola-maintenance.monit-rshg054")
- return
if mail["Subject"].matches("Cron <.*@repo>"):
- mail.move("FOLDERS.software.parabola-maintenance.cron-repo")
+ mail.move("FOLDERS.Ham.software.parabola-maintenance.cron-repo")
return
- if mail["Subject"].matches("Cron <.*@rshg054>"):
- mail.move("FOLDERS.software.parabola-maintenance.cron-rshg054")
+ if mail["Subject"].matches("Cron <.*@parabolagnulinux>"):
+ mail.move("FOLDERS.Ham.software.parabola-maintenance.cron-web")
return
- mail.move("FOLDERS.software.parabola-maintenance")
+ mail.move("FOLDERS.Ham.software.parabola-maintenance")
return
- #if is_to_or_from(mail, "parabola.nu"):
- # mail.move("FOLDERS.software.parabola-labs")
- # return
+ if is_to_or_from(mail, "labs@parabola.nu"):
+ mail.move("FOLDERS.Ham.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")
):
if mail["Subject"].contains("[Django]"):
- mail.move("FOLDERS.software.parabola-maintenance.django")
+ mail.move("FOLDERS.Ham.software.parabola-maintenance.django")
return
- mail.move("FOLDERS.software.parabola-dev")
+ mail.move("FOLDERS.Ham.software.parabola-dev")
return
if (mail["List-Id"].matches("pacman-dev.archlinux.org")):
- mail.move("FOLDERS.software.pacman-dev")
+ mail.move("FOLDERS.Ham.software.pacman-dev")
return
if (mail["List-Id"].matches("systemd-devel.lists.freedesktop.org") or is_to_or_from(mail, "systemd-devel@lists.freedesktop.org")):
- mail.move("FOLDERS.software.systemd-devel")
+ mail.move("FOLDERS.Ham.software.systemd-devel")
return
for subject_re in [
"\[Stow-[^\]]*\].*",
]:
if mail["Subject"].matches(subject_re):
- mail.move("FOLDERS.software")
+ mail.move("FOLDERS.Ham.software")
return
# Sort mail from some social websites
if mail["From"].matches("facebook(|mail)\.com"):
- mail.move("FOLDERS.Social.Facebook")
+ mail.move("FOLDERS.Ham.Social.Facebook")
return
if (
@@ -175,15 +163,15 @@ def my_filters(mail):
or mail["From"].matches("identi\.ca")
or mail["From"].matches("statusnet")
):
- mail.move("FOLDERS.Social.Identica")
+ mail.move("FOLDERS.Ham.Social.Identica")
return
if mail["From"].matches("twitter\.com"):
- mail.move("FOLDERS.Social.Twitter")
+ mail.move("FOLDERS.Ham.Social.Twitter")
return
if mail["From"].matches("@xkcd\.com"):
- mail.move("FOLDERS.Social.xkcd")
+ mail.move("FOLDERS.Ham.Social.xkcd")
return
# Sort mail related to Troop 276
@@ -207,12 +195,12 @@ def my_filters(mail):
or is_to_or_from(mail,"mytroop.us")
or is_to_or_from(mail,"crossroadsbsa.org")
):
- mail.move("FOLDERS.BoyScouts")
+ mail.move("FOLDERS.Ham.BoyScouts")
return
# Sort mail from misc people
if mail["From"].matches("margieshu@sbcglobal\.net"):
- mail.move("FOLDERS.misc.Mom")
+ mail.move("FOLDERS.Ham.misc.Mom")
return
for address in [
@@ -222,7 +210,7 @@ def my_filters(mail):
"jadparso@umail.iu.edu",
]:
if is_to_or_from(mail,address):
- mail.move("FOLDERS.misc.Jade")
+ mail.move("FOLDERS.Ham.misc.Jade")
return
for address in [
@@ -230,7 +218,7 @@ def my_filters(mail):
"nintendo-news.com",
]:
if mail["From"].contains(address):
- mail.move("FOLDERS.misc.Nintendo")
+ mail.move("FOLDERS.Ham.misc.Nintendo")
return
for address in [
@@ -239,7 +227,7 @@ def my_filters(mail):
"CompTIA",
]:
if mail["From"].contains(address):
- mail.move("FOLDERS.misc.CompTIA")
+ mail.move("FOLDERS.Ham.misc.CompTIA")
return
# Sort mail from FRC people
@@ -264,7 +252,7 @@ def my_filters(mail):
"william.walk@gmail.com",
]:
if is_to_or_from(mail,address):
- mail.move("FOLDERS.School.Robotics")
+ mail.move("FOLDERS.Ham.School.Robotics")
return
for subject_re in [
"robotics",
@@ -272,7 +260,7 @@ def my_filters(mail):
"kil-?a-?bytes",
]:
if mail["Subject"].matches(subject_re):
- mail.move("FOLDERS.School.Robotics")
+ mail.move("FOLDERS.Ham.School.Robotics")
return
# Sort mail from software people
@@ -294,7 +282,7 @@ def my_filters(mail):
"trustees@core3.amsl.com",
]:
if is_to_or_from(mail,address):
- mail.move("FOLDERS.software")
+ mail.move("FOLDERS.Ham.software")
return
@@ -304,16 +292,16 @@ def my_filters(mail):
or is_to_or_from(mail, "@lnnorthstar.org")
or is_to_or_from(mail, "lnnorthstar.org@tigertech.net")
):
- mail.move("FOLDERS.School.Newspaper")
+ mail.move("FOLDERS.Ham.School.Newspaper")
return
# Sort mail from various employers/people who pay me
if is_to_or_from(mail, "@precisepath.com"):
- mail.move("FOLDERS.Work.PrecisePath")
+ mail.move("FOLDERS.Ham.Work.PrecisePath")
return
if is_to_or_from(mail,"susyphil@aol.com"):
- mail.move("FOLDERS.Work.PMCH")
+ mail.move("FOLDERS.Ham.Work.PMCH")
for address in [
"d.farrar@comcast.net",
@@ -321,7 +309,7 @@ def my_filters(mail):
"@vmware.com",
]:
if is_to_or_from(mail,address):
- mail.move("FOLDERS.Work.FAST")
+ mail.move("FOLDERS.Ham.Work.FAST")
return
# Sort misc newsletters
@@ -335,7 +323,7 @@ def my_filters(mail):
or mail["From"].contains("info@demandprogress.org")
or (mail["From"].contains("@sparkfun.com") and mail["Message-Id"].contains("rsgsv.net"))
):
- mail.move("FOLDERS.misc.Newsletters")
+ mail.move("FOLDERS.Ham.misc.Newsletters")
return
if (
@@ -351,7 +339,7 @@ def my_filters(mail):
or mail["Subject"].contains("NHS")
or mail["Subject"].contains("National Honor Society")
):
- mail.move("FOLDERS.School")
+ mail.move("FOLDERS.Ham.School")
return
# from college stuff
@@ -360,7 +348,7 @@ def my_filters(mail):
or mail["Subject"].contains("NYLF") # National Youth Leadership Conference
or mail["Subject"].contains("NSHSS")
):
- mail.move("FOLDERS.College.Societies")
+ mail.move("FOLDERS.Ham.College.Societies")
return
if (
False
@@ -373,11 +361,11 @@ def my_filters(mail):
or mail["From"].contains("@dreamitdoitindiana.com")
or mail["From"].contains("@indianatechinfo.org")
):
- mail.move("FOLDERS.College")
+ mail.move("FOLDERS.Ham.College")
return
if mail["From"].contains("@projectwonderful.com"):
- mail.move("FOLDERS.misc.ProjectWonderful")
+ mail.move("FOLDERS.Ham.misc.ProjectWonderful")
return
if (
@@ -387,14 +375,14 @@ def my_filters(mail):
or mail["From"].matches("@[^,>]*\.lukeshu\.ath\.cx")
or mail["To"].matches("luke@")
):
- mail.move("FOLDERS.LocalSystems")
+ mail.move("FOLDERS.Ham.LocalSystems")
return
if (
False
or mail["Subject"].contains("password")
or mail["Subject"].contains("account")
):
- mail.move("FOLDERS.misc.accounts")
+ mail.move("FOLDERS.Ham.misc.accounts")
return
mail.move("FOLDERS.Ham")