dot/gnus-local.el.distorted: Set more splitting variables.
[profile] / dot / gnus-local.el.distorted
1 ;;; -*-emacs-lisp-*-
2 ;;;
3 ;;; Local GNUS configuration -- distorted.org.uk version
4 ;;;
5 ;;; (c) 2014 Mark Wooding
6 ;;;
7
8 ;;;--------------------------------------------------------------------------
9 ;;; How to send mail.
10
11 (and nil
12 (setq smtpmail-smtp-server "mail.distorted.org.uk"
13 smtpmail-sendto-domain "distorted.org.uk"
14 smtpmail-smtp-service 587
15 smtpmail-auth-credentials "~/.gnus.authinfo"
16 message-send-mail-function 'smtpmail-send-it
17 smtpmail-starttls-credentials
18 '(("mail.distorted.org.uk" 587 "" ""))))
19
20 ;;;--------------------------------------------------------------------------
21 ;;; Where we get mail from.
22
23 ;; Read mail on the IMAP server.
24 (setq gnus-secondary-select-methods
25 '((nnimap "distorted"
26 (nnimap-address "mail.distorted.org.uk")
27 (nnimap-stream tls)
28 (nnimap-authinfo-file "~/.gnus.authinfo"))
29 (nnimap "google"
30 (nnimap-address "imap.gmail.com")
31 (nnimap-stream tls)
32 (nnimap-authinfo-file "~/.gnus.authinfo"))))
33
34 ;; Send sent mail back to me.
35 (setq gnus-message-archive-method "mail"
36 gnus-gcc-mark-as-read t
37 gnus-message-archive-group "nnimap+distorted:mail.sent")
38
39 ;;;--------------------------------------------------------------------------
40 ;;; Mail group configuration.
41
42 ;; General splitting configuration.
43 (setq nnimap-split-inbox '("INBOX" "to.split")
44 nnimap-split-rule 'nnimap-split-fancy
45 nnimap-split-methods 'nnimap-split-fancy
46 nnmail-split-methods 'nnmail-split-fancy
47 nnimap-split-predicate "UNDELETED"
48 nnimap-split-crosspost t
49 nnmail-split-crosspost t
50 nnmail-split-fancy-match-partial-words nil)
51
52 ;; Automatic expiry for particular groups.
53 (setq gnus-auto-expirable-newsgroups
54 "^nnimap\\+distorted:\\(crap\\|spam\\|admin\\|lists\\|nag\\)\\..*")
55
56 ;; My various email addresses.
57 (setq message-alternative-emails
58 (concat "^"
59 "\\(" "\\(mdw\\|markw\\|postmaster\\)"
60 "\\([-+][^@]*\\|\\)"
61 "@\\(distorted\\.org\\.uk\\|escorted\\.org\\.uk\\|odin\\.gg\\)"
62 "\\|" "distorted\\.mdw@g\\(oogle\\|\\)mail\\.com"
63 "\\)$")
64 message-dont-reply-to-names message-alternative-emails)
65
66 ;; Mail sent to `mdw-nospam-THING' should appear to come from this address.
67 (setq gnus-posting-styles
68 '(((and (string-match "^nnimap\\+distorted:crap\\.\\(.*\\)$"
69 gnus-newsgroup-name)
70 (setq mdw-from-address
71 (replace-match "mdw-nospam-\\1@distorted.org.uk"
72 nil nil gnus-newsgroup-name)))
73 ("From" mdw-from-address))))
74
75 ;; The actual splitting rules.
76 (setq nnmail-split-fancy
77 '(| (to "\\<\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t)
78 (to "\\<hostmaster@" "admin.dns" t)
79 (to "\\<postmaster@" "admin.mail" t)
80 (to "\\<\\(root\\|mirror\\|postgres\\|spamd\\)@" "admin.misc" t)
81 (to "python-list@python\\.org" "lists.python")
82 (to "mdw-nospam-justgviing@" "crap.justgiving" t)
83 (to "mdw-nospam-\\([^@]+\\)@" "crap.\\1" t)
84 (to "mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t)
85 (from "support@jump\\.net\\.uk" "keep.colo")
86 (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot")
87 (from "\\<mailman-owner@" "nag.mailman" t)
88 (from "cron daemon" "admin.misc")
89 (from "uucp@distorted\\.org\\.uk" "admin.uucp")
90 (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc")
91 (from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t)
92 (from "@amazon\\." "spam.amazon" t)
93 (from "@cineworldmail\\.com" "spam.cineworld" t)
94 (from "@picturehouses\\.co\\.uk" "spam.picturehouse" t)
95 (from "@nationwide" "spam.nationwide" t)
96 (from "@news\\.spotifymail\\.com" "spam.spotify" t)
97 (from "@action\\.openrightsgroup\\.org" "spam.org" t)
98 (from "unlimited@cineworld\\.com" "spam.cineworld" t)
99 (from "nationwide@securesuiteemail\\.com" "spam.nationwide" t)
100 (from "@liberty-human-rights\\.org\\.uk" "spam.liberty" t)
101 (from "@libertymail\\.org\\.uk" "spam.liberty" t)
102 (from "@openrightsgroup\\.org" "spam.org" t)
103 (from "@tshirthell\\.com" "spam.tshirt-hell" t)
104 "mail.misc")
105 nnimap-split-fancy nnmail-split-fancy)
106
107 ;;;----- That's all, folks --------------------------------------------------