chiark / gitweb /
15c76e2ee9cc0954a2db9632833ca6043dde2910
[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 ;;; News via chiark.
22
23 ;; Currently we assume an SSH tunnel.  This will be fixed later.
24 (setq gnus-select-method
25       '(nntp "chiark-ssh-kludge"
26              (nntp-open-connection-function nntp-open-authinfo-kludge)
27              (nntp-address "tunnel.chiark.greenend.org.uk")
28              (nntp-authinfo-generic "md5cookie1way mdw")))
29
30 ;;;--------------------------------------------------------------------------
31 ;;; Where we get mail from.
32
33 ;; Read mail on the IMAP server.
34 (setq gnus-secondary-select-methods
35       '((nnimap "distorted"
36                 (nnimap-address "mail.distorted.org.uk")
37                 (nnimap-stream tls)
38                 (nnimap-authinfo-file "~/.gnus.authinfo"))
39         (nnimap "markw-distorted"
40                 (nnimap-address "mail.distorted.org.uk")
41                 (nnimap-stream tls)
42                 (nnimap-authinfo-file "~/.gnus.authinfo.markw"))
43         (nnimap "mwooding-chiark"
44                 (nnimap-address "imap.dovecot.chiark.greenend.org.uk")
45                 (nnimap-stream tls)
46                 (nnimap-authinfo-file "~/.gnus.authinfo"))
47         (nnimap "google"
48                 (nnimap-address "imap.gmail.com")
49                 (nnimap-stream tls)
50                 (nnimap-authinfo-file "~/.gnus.authinfo"))))
51
52 ;; Send sent mail back to me.
53 (setq gnus-message-archive-method "mail"
54       gnus-gcc-mark-as-read t
55       gnus-message-archive-group "nnimap+distorted:mail.sent")
56
57 ;;;--------------------------------------------------------------------------
58 ;;; Mail group configuration.
59
60 ;; General splitting configuration.
61 (setq nnimap-split-inbox '("INBOX" "to.split")
62       nnimap-split-rule 'nnimap-split-fancy
63       nnimap-split-methods 'nnimap-split-fancy
64       nnmail-split-methods 'nnmail-split-fancy
65       nnimap-split-predicate "UNDELETED"
66       nnimap-split-crosspost t
67       nnmail-split-crosspost t
68       nnmail-split-fancy-match-partial-words nil)
69
70 ;; Automatic expiry for particular groups.
71 (setq gnus-auto-expirable-newsgroups
72       (concat "^"
73               "\\(nnimap\\+[^:]+\\|nnvirtual\\):"
74               "\\(admin\\|crap\\|lists\\|nag\\|spam\\)\\."))
75
76 ;; My various email addresses.
77 (setq message-alternative-emails bbdb-user-mail-names
78       message-dont-reply-to-names message-alternative-emails)
79
80 ;; Mail sent to `mdw-nospam-THING' should appear to come from this address.
81 (setq gnus-posting-styles
82       '(("^nnimap\\+distorted:crap\\."
83          (address (concat "mdw-nospam-"
84                           (substring gnus-newsgroup-name (match-end 0))
85                           "@distorted.org.uk")))))
86
87 ;; The actual splitting rules.
88 (setq nnmail-split-fancy
89       '(|
90           ;; Administrative boxes.
91           (to "\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t)
92           (to "\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t)
93           (to "\\(hostmaster\\)@" "admin.dns" t)
94           (to "\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t)
95           (to "\\(postmaster\\|spamd\\|mailer-daemon\\)@" "admin.mail" t)
96           (to "\\(irc\\|blight\\|ircbot\\)@" "admin.irc" t)
97           (to "\\(www\\|webmaster\\|mtos\\)@" "admin.web" t)
98           (to "\\(ftp\\|ftpadmin\\|mirror\\)@" "admin.ftp" t)
99           (to "\\(abuse\\|security\\)@" "admin.keep" t)
100           (from "cron daemon" "admin.misc")
101           (from "uucp@distorted\\.org\\.uk" "admin.uucp")
102           (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc")
103           (from "bugs@distorted\\.org\\.uk" "admin.bugs")
104
105           ;; Colo provider.
106           (from "\\(accounts\\|support\\)@jump\\.net\\.uk" "keep.colo")
107
108           ;; Mailing lists, not split out earlier.
109           (to "python-list@python\\.org" "lists.python")
110           (to "jump-announce@jump\\.net\\.uk" "lists.jump-announce")
111
112           ;; Per-sender addresses.
113           (to "mdw-nospam-justgviing@" "crap.justgiving" t)
114           (to "mdw-nospam-\\([^@]+\\)@" "crap.\\1" t)
115           (to "mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t)
116
117           ;; Regular nags.
118           (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot")
119           (from "\\<mailman-owner@" "nag.mailman" t)
120
121           ;; Uninteresting mail.
122           (from "expiry@letsencrypt\\.org" "spam.letsencrypt" t)
123
124           ;; Other splits I've not given a per-sender address.
125           (from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t)
126           (from "@amazon\\." "spam.amazon" t)
127           (from "@cineworldmail\\.com" "spam.cineworld" t)
128           (from "@picturehouses\\.co\\.uk" "spam.picturehouse" t)
129           (from "@nationwide" "spam.nationwide" t)
130           (from "@news\\.spotifymail\\.com" "spam.spotify" t)
131           (from "@action\\.openrightsgroup\\.org" "spam.org" t)
132           (from "unlimited@cineworld\\.com" "spam.cineworld" t)
133           (from "nationwide@securesuiteemail\\.com" "spam.nationwide" t)
134           (from "@liberty-human-rights\\.org\\.uk" "spam.liberty" t)
135           (from "@libertymail\\.org\\.uk" "spam.liberty" t)
136           (from "@openrightsgroup\\.org" "spam.org" t)
137           (from "@tshirthell\\.com" "spam.tshirt-hell" t)
138           (from "campaigns@jolla\\.com" "crap.jolla" t)
139
140           ;; Default.
141           "mail.misc")
142       nnimap-split-fancy nnmail-split-fancy)
143
144 ;;;----- That's all, folks --------------------------------------------------