diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-04-14 12:21:50 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-04-14 12:21:50 -0400 |
commit | 94c9bdc5f7e832982947c903c258ea651e27c378 (patch) | |
tree | bf4d435ba6393c3df0ba44ac7703fd2126e01a05 /.config/maildirproc/att.rc | |
parent | b8ea850d1946fc6022d1c0d953aca7583d3cecdd (diff) |
update mail filters
Diffstat (limited to '.config/maildirproc/att.rc')
-rw-r--r-- | .config/maildirproc/att.rc | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index 67335e7..f25aa09 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -15,12 +15,14 @@ def mailman_domain(mail, domain): m = mail["List-Id"].matches("^(.*<|)([^<]*)\."+re.escape(domain)) if m: return m.group(2) + ret = None for hdr in [ 'To', 'Cc', 'From' ]: m = mail[hdr].matches("((\w|-)*)@"+re.escape(domain)) if m: - if mail["Subject"].contains("["+m.group(1)+"]"): - return m.group(1) - return None + ret = m.group(1) + if mail["Subject"].contains("["+ret+"]"): + return ret + return ret def ezmlm_domain(mail, domain): """ @@ -149,17 +151,19 @@ def my_whitelist(mail): def my_filters(mail): # .software.* (GNU Mailman) - for pair in [ [ 'gnu.org', 'gnu' ], # https://lists.gnu.org/mailman/options/bug-librejs/lukeshu@sbcglobal.net - [ 'nongnu.org', 'nongnu' ], # https://lists.nongnu.org/mailman/options/libreboot/lukeshu@sbcglobal.net - [ 'gnome.org', 'gnome' ], # https://mail.gnome.org/mailman/options/networkmanager-list/lukeshu@sbcglobal.net - [ 'archlinux.org', 'archlinux' ], - [ 'lists.freedesktop.org', 'freedesktop' ], - [ 'lists.fedorahosted.org', 'fedorahosted' ], - [ 'lists.arthurdejong.org', 'arthurdejong' ], - [ 'lists.stanford.edu', 'stanford' ], - [ 'mailman.stanford.edu', 'stanford' ], - [ 'lists.parabola.nu', 'parabola' ], - [ 'parabola.nu', 'parabola' ] ]: + for pair in [ + [ 'archlinux.org' , 'archlinux' ], # @sbcglobal.net and @lukeshu.com ; problems delivering to Yahoo! + [ 'gnome.org' , 'gnome' ], # https://mail.gnome.org/mailman/options/networkmanager-list/lukeshu@lukeshu.com + [ 'gnu.org' , 'gnu' ], # https://lists.gnu.org/mailman/options/bug-librejs/lukeshu@lukeshu.com + [ 'lists.arthurdejong.org' , 'arthurdejong' ], + [ 'lists.freedesktop.org' , 'freedesktop' ], # https://lists.freedesktop.org/mailman/options/systemd-devel/lukeshu@lukeshu.com + [ 'lists.parabola.nu' , 'parabola' ], # https://lists.parabola.nu/mailman/options/dev/lukeshu@lukeshu.com + [ 'lists.reproducible-builds.org' , 'reproducible-builds' ], # https://lists.reproducible-builds.org/options/rb-general/lukeshu@lukeshu.com + [ 'nongnu.org' , 'nongnu' ], # https://lists.nongnu.org/mailman/options/gnu-linux-libre/lukeshu@lukeshu.com + [ 'redhat.com' , 'redhat' ], # https://www.redhat.com/mailman/options/pam-list/lukeshu@lukeshu.com + [ 'lists.stanford.edu', 'stanford' ], + [ 'mailman.stanford.edu', 'stanford' ], + ]: list = mailman_domain(mail, pair[0]) if list: move_ham(mail, ".software."+pair[1]+"."+list) @@ -182,6 +186,7 @@ def my_filters(mail): or is_to_or_from(mail, "parabolagnulinux.org") or is_to_or_from(mail, "parabola.nu") or is_to_or_from(mail, "kiwwwi.com.ar") + or is_to_or_from(mail, "jon@whiteheat.org.uk") ): move_ham(mail, ".software.parabola") return |