summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-14 12:21:50 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:18:27 -0500
commitc5c39eb8c02c040f077b8a43999e88af40790a42 (patch)
treeb5ae7f1bd42dec71edf00c4bf7ebfef94ed2c71d
parent8e046f1b3f39bd2c5bca498965c7d082057982dd (diff)
update mail filters
-rw-r--r--.config/maildirproc/att.rc33
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