diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-01-29 01:36:26 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-01-29 01:36:26 -0500 |
commit | e9319a2e348b33eeb0f5bfcdd26ef885590cf8cb (patch) | |
tree | 146dfdb0581ca6ba128bffe3898befb2046fcb54 /.config/maildirproc/att.rc | |
parent | 6b1e58597e228a886f125efa64e57c3f94bfd259 (diff) |
update mail filters
Diffstat (limited to '.config/maildirproc/att.rc')
-rw-r--r-- | .config/maildirproc/att.rc | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index b8ff8f1..6b31260 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -1,6 +1,7 @@ # -*- mode: python; indent-tabs-mode: t -*- import os +import os.path import subprocess import datetime @@ -27,7 +28,14 @@ def is_to_or_from_re(mail,address): or mail.target.matches(address)) def move_ham(mail,folder): y = datetime.datetime.now().year - mail.move("FOLDERS.Ham."+str(y)+folder) + folder = "FOLDERS.Ham."+str(y)+folder + dir = processor.maildir_base+"/"+folder + if not os.path.isfile(dir+"/maildirfolder"): + os.makedirs(dir+"/tmp", 0o777, True) + os.makedirs(dir+"/new", 0o777, True) + os.makedirs(dir+"/cur", 0o777, True) + open(dir+"/maildirfolder", 'a').close() + mail.move(folder) def bogofilter_auto(mail): p = subprocess.Popen( @@ -127,7 +135,7 @@ def my_filters(mail): move_ham(mail,".software.networkmanager") return - if mail["List-Id"].matches("maintenance.lists.parabolagnulinux.org"): + if mail["List-Id"].matches("maintenance\.lists\.parabola(gnulinux\.org|\.nu)"): move_ham(mail,".software.parabola.maintenance") return @@ -137,7 +145,8 @@ def my_filters(mail): if ( False - or mail["List-Id"].matches("parabolagnulinux.org") + or mail["List-Id"].matches("parabolagnulinux\.org") + or mail["List-Id"].matches("parabola\.nu") 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") @@ -281,19 +290,19 @@ def my_filters(mail): # Sort mail from software people for address in [ "@archlinux.org", + "@canonical.org", + "@cnuk.org", + "@eff.org", + "@foocorp.net", "@fsf.org", "@github.com", - "canonical.org", - "cnuk.org", - "eff.org", - "esr@thyrsus.com", - "foocorp.net", - "gitorious.org", - "gnome.org", - "gnu.org", - "ietf.org", - "kde.org", - "sourceforge.com", + "@gitorious.org", + "@gnome.org", + "@gnu.org", + "@ietf.org", + "@kde.org", + "@sourceforge.com", + "@thyrsus.com", "trustees@core3.amsl.com", ]: if is_to_or_from(mail,address): |