X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/3a268ef9420b3076b493182bcb4e2fb767b582a1..161ca534b9551db731f4d70f41c6cbbe49b34ad4:/dot/gnus-local.el.distorted diff --git a/dot/gnus-local.el.distorted b/dot/gnus-local.el.distorted index 15c011e..2e64c00 100644 --- a/dot/gnus-local.el.distorted +++ b/dot/gnus-local.el.distorted @@ -62,9 +62,7 @@ ;;; Mail group configuration. ;; General splitting configuration. -(setq nnimap-split-inbox '("INBOX" "to.split") - nnimap-split-rule 'nnimap-split-fancy - nnimap-split-methods 'nnimap-split-fancy +(setq nnimap-split-rule 'nnimap-split-fancy nnmail-split-methods 'nnmail-split-fancy nnimap-split-predicate "UNDELETED" nnimap-split-crosspost t @@ -75,7 +73,9 @@ (setq gnus-auto-expirable-newsgroups (concat "^" "\\(nnimap\\+[^:]+\\|nnvirtual\\):" - "\\(admin\\|crap\\|lists\\|nag\\|spam\\)\\.")) + "\\(" "\\(admin\\|crap\\|lists\\|nag\\|spam\\)\\." + "\\|" "spam\\.oubliette" + "\\)")) ;; My various email addresses. (setq message-alternative-emails bbdb-user-mail-names @@ -93,9 +93,33 @@ (address "distorted.mdw@gmail.com") ("X-mdw-Send-Mail" "gmail-smtp")))) +(defvar mdw-odin-parse-regexp + (concat "^" + "\\S-+" "\\s-+" ; time limit + "\\(" "\\S-+" "\\)" "\\s-+" ; local part + "\\S-+" "\\s-+" ; recipient email address + "=" "\\(" "\\S-+" "\\)" ; mailbox tag + "\\(" "$" "\\|" "\\s-" "\\)")) + +(defun mdw-odin-splits () + (let ((list nil)) + (with-temp-buffer + (call-process "ssh" nil t nil + "stratocaster" "userv" "odin" "mail" "list") + (goto-char (point-min)) + (while (< (point) (point-max)) + (when (looking-at mdw-odin-parse-regexp) + (let ((local-part (match-string 1)) + (tag (match-string 2))) + (push `(to ,(format "%s@odin\\.gg" local-part) + ,(format "crap.%s" tag)) + list))) + (forward-line))) + (nreverse list))) + ;; The actual splitting rules. (setq nnmail-split-fancy - '(| + `(| ;; Administrative boxes. (to "\\<\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t) (to "\\<\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t) @@ -125,6 +149,10 @@ (to "\\" "spam.cineworld" t) (from "@picturehouses\\.co\\.uk\\>" "spam.picturehouse" t) - (from "@nationwide" "spam.nationwide\\>" t) + (from "@nationwide" "spam.nationwide" t) (from "@news\\.spotifymail\\.com\\>" "spam.spotify" t) (from "@action\\.openrightsgroup\\.org\\>" "spam.org" t) (from "unlimited@cineworld\\.com\\>" "spam.cineworld" t) @@ -149,28 +177,30 @@ (from "campaigns@jolla\\.com\\>" "crap.jolla" t) ;; Default. - "mail.misc") - nnimap-split-fancy nnmail-split-fancy) + "mail.misc")) ;;;-------------------------------------------------------------------------- ;;; Where we get mail from. ;; Read mail on the IMAP server. (setq gnus-secondary-select-methods - '((nnimap "distorted" + `((nnimap "distorted" (nnimap-address "mail.distorted.org.uk") (nnimap-stream starttls) - (nnimap-inbox "INBOX") + (nnimap-inbox ("INBOX" "to.split")) + (nnimap-split-methods nnimap-split-fancy) + (nnimap-split-fancy ,nnmail-split-fancy) (nnimap-unsplittable-articles (%Deleted))) (nnimap "markw-distorted" (nnimap-address "mail.distorted.org.uk") (nnimap-stream starttls) - (nnimap-inbox "INBOX") + (nnimap-inbox ("INBOX" "to.split")) + (nnimap-split-methods nnimap-split-fancy) + (nnimap-split-fancy ,nnmail-split-fancy) (nnimap-unsplittable-articles (%Deleted))) (nnimap "mwooding-chiark" (nnimap-address "imap.dovecot.chiark.greenend.org.uk") (nnimap-stream starttls) - (starttls-extra-arguments ("--insecure")) (nnimap-inbox "INBOX") (nnimap-unsplittable-articles (%Deleted))) (nnimap "google"