summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:10:38 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:19:12 -0500
commit65a5662ffb11e76b68f81ee24c37d74e49bd0d98 (patch)
tree30328ca34c875f595a33f6d94065327c15e311de
parentc5c39eb8c02c040f077b8a43999e88af40790a42 (diff)
Revamp mail filtering and organization
-rw-r--r--.config/Makefile16
-rw-r--r--.config/emacs/wl.el12
-rw-r--r--.config/maildirproc/default.rc (renamed from .config/maildirproc/att.rc)328
-rw-r--r--.config/offlineimap/config34
l---------.config/systemd/user/default.target.wants/maildirproc@default.service1
5 files changed, 243 insertions, 148 deletions
diff --git a/.config/Makefile b/.config/Makefile
index 4e8166e..62c639e 100644
--- a/.config/Makefile
+++ b/.config/Makefile
@@ -21,8 +21,20 @@ clean:
rm -f -- $(targets)
.PHONY: all clean
-${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST)
- find -L $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' > '$@'
+ifneq ($(wildcard ${HOME}/Maildir),)
+MAILDIRS = .
+-include ${STATEDIR}/maildirs.mk
+${HOME}/.folders: $(addprefix ${HOME}/Maildir/,${MAILDIRS})
+ find -L $< \( -false \
+ -o -type f -name maildirfolder \
+ -o -type d -name new \
+ -o -type d -name tmp \
+ -o -type d -name cur \
+ \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' > '$@'
+${STATEDIR}/maildirs.mk: ${HOME}/.folders
+ < $< sed -n 's/^\.//p' | xargs -d $$'\n' -r dirname -- | sort -u | xargs -d $$'\n' -r printf 'MAILDIRS += %s\n' > $@
+endif
+
${GIT_DIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/)
( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@
diff --git a/.config/emacs/wl.el b/.config/emacs/wl.el
index c27c87e..08d9ec3 100644
--- a/.config/emacs/wl.el
+++ b/.config/emacs/wl.el
@@ -18,12 +18,12 @@
;; note: all below are dirs (Maildirs) under elmo-maildir-folder-path
;; the '.'-prefix is for marking them as maildirs
- wl-fcc ".Sent" ;; sent msgs go to the "sent"-folder
- wl-default-folder ".FOLDERS.Ham" ;; my main inbox
- wl-draft-folder ".Draft" ;; store drafts in 'postponed'
- wl-trash-folder ".Trash" ;; put trash in 'trash'
- wl-spam-folder ".FOLDERS.Spam.training" ;; put spam in 'Bulk Mail'
- wl-queue-folder ".FOLDERS.Queue" ;; we don't use this
+ wl-default-folder ".MAIN/Ham.2017"
+ wl-spam-folder ".QUEUES/Spam"
+ wl-draft-folder ".WL/Draft"
+ wl-trash-folder ".WL/Trash"
+ wl-queue-folder ".WL/Queue"
+ wl-fcc ".WL/Sent"
;; check this folder periodically, and update modeline
;wl-biff-check-folder-list '(".todo") ;; check every 180 seconds
diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/default.rc
index f25aa09..e264cc3 100644
--- a/.config/maildirproc/att.rc
+++ b/.config/maildirproc/default.rc
@@ -1,38 +1,81 @@
-# -*- mode: python; indent-tabs-mode: t -*-
+#!/hint/python3
+# -*- indent-tabs-mode: t -*-
import os
import os.path
import subprocess
import datetime
import re
+import email.utils
#
# Mail attribute utilities
+def parse_address(x):
+ return email.utils.parseaddr(str(x))[1]
+def parse_addresses(x):
+ return [p[1] for p in email.utils.getaddresses([str(x)])]
+
+def match_re(x, pat):
+ return re.fullmatch(pat, x, re.IGNORECASE)
+def match_glob(x, glob):
+ if '@' in glob:
+ if glob.startswith('@'):
+ return x.lower().endswith(glob.lower())
+ return x.lower() == glob.lower()
+ else:
+ return x.lower().endswith('@'+glob.lower()) or x.lower().endswith('.'+glob.lower())
+
+def originator_addresses(mail):
+ return [p[1] for p in email.utils.getaddresses([
+ str(mail['From']),
+ str(mail['Sender']),
+ str(mail['Reply-To']),
+ ]) if p[1] != '']
+
+def destination_addresses(mail):
+ return [p[1] for p in email.utils.getaddresses([
+ str(mail['To']),
+ str(mail['Cc']),
+ str(mail['Bcc']),
+ ]) if p[1] != '']
+def all_addresses(mail):
+ return originator_addresses(mail) + destination_addresses(mail)
+
def mailman_domain(mail, domain):
"""
Return a string that is the list-name for a mailman domain
"""
- m = mail["List-Id"].matches("^(.*<|)([^<]*)\."+re.escape(domain))
+ m = match_re(parse_address(mail["List-Id"]), "(.*)\."+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))
+ return m.group(1)
+ if mail["List-Id"] != "":
+ return None
+ for addr in destination_addresses(mail):
+ m = match_re(addr, "(.*)@"+re.escape(domain))
if m:
ret = m.group(1)
if mail["Subject"].contains("["+ret+"]"):
return ret
- return ret
+ return None
def ezmlm_domain(mail, domain):
"""
Return a string that is the list-name for a ezmlm domain
"""
- m = mail["Mailing-List"].matches("^(.* )?(\w+)(-\S*)?@"+re.escape(domain)+"(;.*)?$")
+ m = match_re(parse_address(mail["List-Id"]), "(.*)\."+re.escape(domain))
if m:
- return m.group(2)
- for hdr in [ 'To', 'Cc', 'From' ]:
- m = mail[hdr].matches("(\w)@"+re.escape(domain))
+ return m.group(1)
+ if mail["List-Id"] != "":
+ return None
+ ml = [s.strip() for s in str(mail["Mailing-List"]).split(";")]
+ if 'run by ezmlm' in ml:
+ contacts = [s[7:].strip() for s in ml if s.startswith('contact ')]
+ for contact in contacts:
+ m = match_re(contact, "(.+)-help@"+re.escape(domain))
+ if m:
+ return m.group(1)
+ for addr in destination_addresses(mail):
+ m = match_re(addr, "(.*)@"+re.escape(domain))
if m:
return m.group(1)
return None
@@ -41,31 +84,26 @@ def majordomo_domain(mail, domain):
"""
Return a string that is the list-name for a majordomo domain
"""
- m = mail["List-Id"].matches("^(.*<|)([^<]*)\."+re.escape(domain))
+ m = match_re(parse_address(mail["List-Id"]), "(.*)\."+re.escape(domain))
if m:
- return m.group(2)
- for hdr in [ 'To', 'Cc', 'From' ]:
- m = mail[hdr].matches("((\w|-)*)@"+re.escape(domain))
+ return m.group(1)
+ if mail["List-Id"] != "":
+ return None
+ for addr in destination_addresses(mail):
+ m = match_re(addr, "(.*)@"+re.escape(domain))
if m:
return m.group(1)
+ return None
+
+def is_from(mail, address):
+ return any(match_glob(addr, address) for addr in originator_addresses(mail))
+def is_from_re(mail, address):
+ return any(match_re(addr, address) for addr in originator_addresses(mail))
def is_to_or_from(mail, address):
- """
- Return true if [mail] is to or from an address that contains [address].
- """
- return (
- False
- or mail["From"].contains(address)
- or mail["Reply-To"].contains(address)
- or mail.target.contains(address))
+ return any(match_glob(addr, address) for addr in all_addresses(mail))
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))
+ return any(match_re(addr, address) for addr in all_addresses(mail))
#
# bogofilter utilites
@@ -90,59 +128,61 @@ def bogofilter_spam(mail):
def move_ham(mail, folder):
y = datetime.datetime.now().year
- folder = "FOLDERS.Ham."+str(y)+folder
+ folder = "MAIN/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()
+ subprocess.call(['make', '-C', os.environ['XDG_CONFIG_HOME']])
mail.move(folder)
def my_whitelist(mail):
return (
False
- or is_to_or_from(mail, "@opengroup.org")
- or is_to_or_from(mail, "@purestorage.com")
- or is_to_or_from(mail, "@vger.kernel.org")
+ or is_to_or_from(mail, "opengroup.org")
+ or is_to_or_from(mail, "purestorage.com")
+ or is_to_or_from(mail, "sourceware.org")
+ or is_to_or_from(mail, "vger.kernel.org")
or is_to_or_from(mail, "Bryan@ChankTunUnGi.onmicrosoft.com")
or is_to_or_from(mail, "cacnedcomms@gmail.com")
or is_to_or_from(mail, "fsf.org")
or is_to_or_from(mail, "gnu.org")
or is_to_or_from(mail, "parabola.nu")
or is_to_or_from(mail, "parabolagnulinux.org")
- or mail["From"] == "3174451635@mms.att.net"
- or mail["From"] == "MAILER-DAEMON@yahoo.com"
- or mail["From"].contains("@careereco.com")
- or mail["From"].contains("@ciholas.com")
- or mail["From"].contains("@e.oldnational.com>")
- or mail["From"].contains("@facebookmail.com>")
- or mail["From"].contains("@gandi.net")
- or mail["From"].contains("@github.com>")
- or mail["From"].contains("@goodwillindy.org>")
- or mail["From"].contains("@kickstarter.com>")
- or mail["From"].contains("@list.cr.yp.to")
- or mail["From"].contains("@lpi.org>")
- or mail["From"].contains("@lulzbot.com>")
- or mail["From"].contains("@mail.scribd.com>")
- or mail["From"].contains("@massdrop.com>")
- or mail["From"].contains("@msdlt.k12.in.us>")
- or mail["From"].contains("@parabola.nu")
- or mail["From"].contains("@post.oreilly.com>")
- or mail["From"].contains("@scouting.org>")
- or mail["From"].contains("@solutionsinplastic.com>")
- or mail["From"].contains("@startcom.org>")
- or mail["From"].contains("@usfirst.org>")
- or mail["From"].contains("@vectren.com")
- or mail["From"].contains("@vectrenemail.com")
- or mail["From"].contains("@wolframalpha.com>")
- or mail["From"].contains("Promo@email.newegg.com")
- or mail["From"].contains("info@email2.mysimplemobile.com")
- or mail["From"].contains("margieshu@sbcglobal.net")
- or mail["From"].contains("parabolagnulinux.org")
- or mail["From"].matches("@[a-z]+\.gandi\.net")
- or mail["List-Id"].matches(".*\.(gnu|gnome|archlinux|parabolagnulinuxlibre|fedorahosted)\.org")
- or mail["List-Id"].matches(".*\.parabola\.nu")
+ or is_from(mail, "3174451635@mms.att.net")
+ or is_from(mail, "MAILER-DAEMON@yahoo.com")
+ or is_from(mail, "careereco.com")
+ or is_from(mail, "ciholas.com")
+ or is_from(mail, "e.oldnational.com")
+ or is_from(mail, "facebookmail.com")
+ or is_from(mail, "gandi.net")
+ or is_from(mail, "github.com")
+ or is_from(mail, "goodwillindy.org")
+ or is_from(mail, "kickstarter.com")
+ or is_from(mail, "list.cr.yp.to")
+ or is_from(mail, "lpi.org")
+ or is_from(mail, "lulzbot.com")
+ or is_from(mail, "mail.scribd.com")
+ or is_from(mail, "massdrop.com")
+ or is_from(mail, "msdlt.k12.in.us")
+ or is_from(mail, "parabola.nu")
+ or is_from(mail, "post.oreilly.com")
+ or is_from(mail, "scouting.org")
+ or is_from(mail, "solutionsinplastic.com")
+ or is_from(mail, "startcom.org")
+ or is_from(mail, "usfirst.org")
+ or is_from(mail, "vectren.com")
+ or is_from(mail, "vectrenemail.com")
+ or is_from(mail, "wolframalpha.com")
+ or is_from(mail, "Promo@email.newegg.com")
+ or is_from(mail, "info@email2.mysimplemobile.com")
+ or is_from(mail, "margieshu@sbcglobal.net")
+ or is_from(mail, "parabolagnulinux.org")
+ or is_from(mail, "gandi.net")
+ or match_re(parse_address(mail["List-Id"]), ".*\.(gnu|gnome|archlinux|parabolagnulinuxlibre|fedorahosted)\.org")
+ or match_re(parse_address(mail["List-Id"]), ".*\.parabola\.nu")
or mail["Subject"].contains("[Dev]")
or mail["Subject"].contains("[Maintenance]")
or mail["Subject"].contains("[PATCH")
@@ -150,30 +190,46 @@ def my_whitelist(mail):
)
def my_filters(mail):
+ if mail["From"].contains("Parabola Website Notification <nobody@parabola.nu>"):
+ move_ham(mail, ".software.parabola.dev.web-notif")
+ return
+
+ # .software.POSIX (custom mlm, I think)
+ if is_to_or_from(mail, "austin-group-l@opengroup.org"):
+ move_ham(mail, ".software.POSIX")
+ return
# .software.* (GNU Mailman)
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.fedorahosted.org' , 'fedorahosted' ],
[ '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' ],
+ [ 'lists.stanford.edu' , 'stanford' ],
+ [ 'mailman.stanford.edu' , 'stanford' ],
+
]:
list = mailman_domain(mail, pair[0])
if list:
move_ham(mail, ".software."+pair[1]+"."+list)
return
# .software.* (EZMLM)
- for pair in [ [ 'list.cr.yp.to', 'djb' ] ]:
+ for pair in [
+ [ 'list.cr.yp.to', 'djb' ],
+ [ 'sourceware.org', 'sourceware' ],
+ ]:
list = ezmlm_domain(mail, pair[0])
if list:
move_ham(mail, ".software."+pair[1]+"."+list)
return
+ if is_from(mail, "sourceware-bugzilla@sourceware.org"):
+ move_ham(mail, ".software.sourceware-bugzilla")
+ return
# .software.* (Majordomo)
for pair in [ [ 'vger.kernel.org', 'kernel' ] ]:
list = majordomo_domain(mail, pair[0])
@@ -183,43 +239,45 @@ def my_filters(mail):
# .software.parabola
if (
False
- or is_to_or_from(mail, "parabolagnulinux.org")
- or is_to_or_from(mail, "parabola.nu")
+ or is_to_or_from(mail, "ceata.org")
or is_to_or_from(mail, "kiwwwi.com.ar")
+ or is_to_or_from(mail, "endefensadelsl.org")
+ or is_to_or_from(mail, "parabola.nu")
+ or is_to_or_from(mail, "parabolagnulinux.org")
+ or is_to_or_from(mail, "xylon.me.uk")
+ or False
+ or is_to_or_from(mail, "g4jc@openmailbox.org")
or is_to_or_from(mail, "jon@whiteheat.org.uk")
+ or is_to_or_from(mail, "srw@openmailbox.org")
+ or is_to_or_from(mail, "eliotime3000@openmailbox.org")
):
move_ham(mail, ".software.parabola")
return
- # .software.POSIX
- if is_to_or_from(mail, "austin-group-l@opengroup.org"):
- move_ham(mail, ".software.POSIX")
- return
# .software.TravisCI
- if mail["From"].contains("builds@travis-ci.org"):
+ if is_from(mail, "builds@travis-ci.org"):
move_ham(mail, ".software.TravisCI")
return
# .software
for address in [
- "@archlinux.org",
- "@canonical.org",
- "@cnuk.org",
- "@core3.amsl.com",
- "@defectivebydesign.org",
- "@eff.org",
- "@fedorahosted.org",
- "@foocorp.net",
- "@fsf.org",
- "@github.com",
- "@gitorious.org",
- "@gnome.org",
- "@gnu.org",
- "@ietf.org",
- "@kde.org",
- "@lists.fedorahosted.org",
- "@mozilla.org",
- "@nongnu.org",
- "@sourceforge.com",
- "@thyrsus.com",
+ "archlinux.org",
+ "canonical.org",
+ "cnuk.org",
+ "core3.amsl.com",
+ "defectivebydesign.org",
+ "eff.org",
+ "fedorahosted.org",
+ "foocorp.net",
+ "fsf.org",
+ "github.com",
+ "gitorious.org",
+ "gnome.org",
+ "gnu.org",
+ "ietf.org",
+ "kde.org",
+ "mozilla.org",
+ "nongnu.org",
+ "sourceforge.com",
+ "thyrsus.com",
]:
if is_to_or_from(mail, address):
move_ham(mail, ".software")
@@ -227,31 +285,42 @@ def my_filters(mail):
# .servers
if (
False
- or mail["From"].contains("@gandi.net")
- or mail["From"].contains("@ramhost.us")
- or mail["From"].contains("@startcom.org")
- or mail["From"].contains("@startssl.com")
- or mail["From"].contains("@vultr.com")
- or (mail["From"].contains("@2co.com") and mail["Subject"].contains("RAM Host"))
+ or is_from(mail, "gandi.net")
+ or is_from(mail, "ramhost.us")
+ or is_from(mail, "startcom.org")
+ or is_from(mail, "startssl.com")
+ or is_from(mail, "vultr.com")
+ or (is_from(mail, "@2co.com") and mail["Subject"].contains("RAM Host"))
+ or is_from(mail, "localhost")
+ or is_from(mail, "local")
+ or is_from(mail, "lan")
+ or is_from(mail, "lukeshu.com")
):
move_ham(mail, ".servers")
return
# .Social.*
- if mail["From"].matches("facebook(|mail)\.com"):
+ if is_from_re(mail, ".*[@.]facebook(|mail)\.com"):
move_ham(mail, ".Social.Facebook")
return
- if mail["From"].matches("identi\.ca|statusnet"):
+ if is_from(mail, "identi.ca"):
move_ham(mail, ".Social.Identica")
return
- if mail["From"].matches("twitter\.com"):
+ if is_from(mail, "twitter.com"):
move_ham(mail, ".Social.Twitter")
return
- if mail["From"].matches("@xkcd\.com"):
+ if is_from(mail, "xkcd.com"):
move_ham(mail, ".Social.xkcd")
return
- if is_to_or_from(mail, "linkedin.com"):
+ if is_from(mail, "linkedin.com"):
move_ham(mail, ".Social.LinkedIn")
return
+ # .jobs.*
+ if is_from(mail, "guru.com"):
+ move_ham(mail, ".jobs.Guru")
+ return
+ if is_from(mail, "glassdoor.com"):
+ move_ham(mail, ".jobs.Glassdoor")
+ return
# .BSA
if (
False
@@ -280,7 +349,7 @@ def my_filters(mail):
move_ham(mail, ".BSA")
return
# .FRC
- for address in [ "@ni.com", "@usfirst.org", "@firstinspires.org" ]:
+ for address in [ "ni.com", "usfirst.org", "firstinspires.org" ]:
if is_to_or_from(mail, address):
move_ham(mail, ".FRC")
return
@@ -322,7 +391,10 @@ def my_filters(mail):
or mail["Subject"].contains("[ME297]")
or is_to_or_from(mail, "firstteam4272@gmail.com")
or is_to_or_from(mail, "@tscstudents.net")
+ or is_to_or_from(mail, "@tsc.k12.in.us")
+ or is_to_or_from(mail, "ericjoelsells@gmail.com")
or is_to_or_from(mail, "abenyeho@purdue.edu")
+ or is_to_or_from(mail, "alexhenry@purdue.edu")
or is_to_or_from(mail, "Henry65@purdue.edu")
or is_to_or_from(mail, "chang282@purdue.edu")
):
@@ -370,10 +442,10 @@ def my_filters(mail):
move_ham(mail, ".Purdue.misc")
return
# .misc.*
- if mail["From"].matches("schwab\.com"):
+ if is_from(mail, "schwab.com"):
move_ham(mail, ".misc.schwab")
return
- if mail["From"].matches("@ebay\.com"):
+ if is_from(mail, "ebay.com"):
move_ham(mail, ".misc.ebay")
return
if (
@@ -383,13 +455,15 @@ def my_filters(mail):
):
move_ham(mail, ".misc.Mom")
return
+ if is_to_or_from(mail, "freelancer.com"):
+ move_ham(mail, ".misc.Freelancer")
+ return
for address in [
- "@lpi.org",
- "@pearson.com",
+ "lpi.org",
+ "pearson.com",
"ciscotraining-notify@cisco.com",
- "CompTIA",
]:
- if mail["From"].contains(address):
+ if is_from(mail, address):
move_ham(mail, ".misc.CompTIA")
return
if (
@@ -424,15 +498,6 @@ def my_filters(mail):
return
if (
False
- or mail["From"].matches("@localhost")
- or mail["From"].matches("@[^,>]*\.local")
- or mail["From"].matches("@[^,>]*\.lan")
- or mail["To"].matches("luke@")
- ):
- move_ham(mail, ".misc.LocalSystems")
- return
- if (
- False
or mail["Subject"].contains("password")
or mail["Subject"].contains("account")
or mail["From"].contains("accounts")
@@ -449,12 +514,12 @@ def handle_incoming_ham_training(mail):
handle_incoming_ham(mail)
def handle_incoming_spam_training(mail):
bogofilter_spam(mail)
- mail.move("FOLDERS.Spam")
+ mail.move("MAIN/Spam")
def handle_incoming_ham(mail):
my_filters(mail)
def handle_incoming_spam(mail):
- mail.move("FOLDERS.Spam")
+ mail.move("MAIN/Spam")
def handle_incoming_unknown(mail):
# Whitelist
@@ -470,20 +535,21 @@ def handle_incoming_unknown(mail):
handle_incoming_ham(mail)
return
elif spam == 2:
- mail.move("FOLDERS.MysteryMeat")
+ mail.move("MAIN/MysteryMeat")
return
else:
- mail.move("FOLDERS.BogoFail")
+ mail.move("MAIN/BogoFail")
return
# hook the above functions into the maildirproc processor
processor.maildir_base = "~/Maildir"
processor.auto_reload_rcfile = True
handle_mapping = {
- "Inbox": handle_incoming_unknown,
- "Bulk Mail": handle_incoming_unknown, # fucking Yahoo!
- "FOLDERS.Spam.training": handle_incoming_spam_training,
- "FOLDERS.Ham.training": handle_incoming_ham_training,
+ "REMOTES/ATT/Inbox": handle_incoming_unknown,
+ "REMOTES/ATT/Bulk Mail": handle_incoming_unknown, # fucking Yahoo!
+ "REMOTES/lukeshu/INBOX": handle_incoming_unknown,
+ "QUEUES/Spam": handle_incoming_spam_training,
+ "QUEUES/Ham": handle_incoming_ham_training,
}
processor.maildirs = handle_mapping.keys()
for mail in processor:
diff --git a/.config/offlineimap/config b/.config/offlineimap/config
index 2fc6ecc..b3262b2 100644
--- a/.config/offlineimap/config
+++ b/.config/offlineimap/config
@@ -1,26 +1,42 @@
# -*- Mode: Conf -*-
[general]
-accounts = ATT
+accounts = ATT,lukeshu
metadata = ~/.local/share/offlineimap
## AT&T ###############################################################
[Account ATT]
-localrepository = Local-Main
-remoterepository = Remote-SBCGlobal
+localrepository = Local-ATT
+remoterepository = Remote-ATT
-[Repository Local-Main]
+[Repository Local-ATT]
type = Maildir
-localfolders = ~/Maildir
+localfolders = ~/Maildir/REMOTES/ATT
sep = .
-folderfilter = lambda folder: folder in [ 'Inbox', 'Bulk Mail' ]
-[Repository Remote-SBCGlobal]
+[Repository Remote-ATT]
type = IMAP
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
auth_mechanisms = PLAIN
remotehost = imap.mail.yahoo.com
remoteuser = lukeshu@sbcglobal.net
-folderfilter = lambda folder: folder in [ 'Inbox', 'Bulk Mail' ]
-idlefolders = [ 'Inbox', 'Bulk Mail' ]
+
+## lukeshu.com ########################################################
+
+[Account lukeshu]
+localrepository = Local-lukeshu
+remoterepository = Remote-lukeshu
+
+[Repository Local-lukeshu]
+type = Maildir
+localfolders = ~/Maildir/REMOTES/lukeshu
+sep = .
+
+[Repository Remote-lukeshu]
+type = IMAP
+ssl = yes
+sslcacertfile = /etc/ssl/certs/ca-certificates.crt
+auth_mechanisms = PLAIN
+remotehost = mav.lukeshu.com
+remoteuser = lukeshu
diff --git a/.config/systemd/user/default.target.wants/maildirproc@default.service b/.config/systemd/user/default.target.wants/maildirproc@default.service
new file mode 120000
index 0000000..13e527c
--- /dev/null
+++ b/.config/systemd/user/default.target.wants/maildirproc@default.service
@@ -0,0 +1 @@
+../maildirproc@.service \ No newline at end of file