Merge branch 'master' of https://git.distorted.org.uk/~mdw/profile
[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 "google"
44 (nnimap-address "imap.gmail.com")
45 (nnimap-stream tls)
46 (nnimap-authinfo-file "~/.gnus.authinfo"))))
47
48 ;; Send sent mail back to me.
49 (setq gnus-message-archive-method "mail"
50 gnus-gcc-mark-as-read t
51 gnus-message-archive-group "nnimap+distorted:mail.sent")
52
53 ;;;--------------------------------------------------------------------------
54 ;;; Mail group configuration.
55
56 ;; General splitting configuration.
57 (setq nnimap-split-inbox '("INBOX" "to.split")
58 nnimap-split-rule 'nnimap-split-fancy
59 nnimap-split-methods 'nnimap-split-fancy
60 nnmail-split-methods 'nnmail-split-fancy
61 nnimap-split-predicate "UNDELETED"
62 nnimap-split-crosspost t
63 nnmail-split-crosspost t
64 nnmail-split-fancy-match-partial-words nil)
65
66 ;; Automatic expiry for particular groups.
67 (setq gnus-auto-expirable-newsgroups
68 "^nnimap\\+distorted:\\(crap\\|spam\\|admin\\|lists\\|nag\\)\\..*")
69
70 ;; My various email addresses.
71 (setq message-alternative-emails bbdb-user-mail-names
72 message-dont-reply-to-names message-alternative-emails)
73
74 ;; Mail sent to `mdw-nospam-THING' should appear to come from this address.
75 (setq gnus-posting-styles
76 '(((and (string-match "^nnimap\\+distorted:crap\\.\\(.*\\)$"
77 gnus-newsgroup-name)
78 (setq mdw-from-address
79 (replace-match "mdw-nospam-\\1@distorted.org.uk"
80 nil nil gnus-newsgroup-name)))
81 ("From" mdw-from-address))))
82
83 ;; The actual splitting rules.
84 (setq nnmail-split-fancy
85 '(|
86 ;; Administrative boxes.
87 (to "\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t)
88 (to "\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t)
89 (to "\\(hostmaster\\)@" "admin.dns" t)
90 (to "\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t)
91 (to "\\(postmaster\\|spamd\\|mailer-daemon\\)@" "admin.mail" t)
92 (to "\\(irc\\|blight\\|ircbot\\)@" "admin.irc" t)
93 (to "\\(www\\|webmaster\\|mtos\\)@" "admin.web" t)
94 (to "\\(ftp\\|ftpadmin\\|mirror\\)@" "admin.ftp" t)
95 (to "\\(abuse\\|security\\)@" "admin.keep" t)
96 (from "cron daemon" "admin.misc")
97 (from "uucp@distorted\\.org\\.uk" "admin.uucp")
98 (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc")
99 (from "bugs@distorted\\.org\\.uk" "admin.bugs")
100
101 ;; Colo provider.
102 (from "\\(accounts\\|support\\)@jump\\.net\\.uk" "keep.colo")
103
104 ;; Mailing lists, not split out earlier.
105 (to "python-list@python\\.org" "lists.python")
106 (to "jump-announce@jump\\.net\\.uk" "lists.jump-announce")
107
108 ;; Per-sender addresses.
109 (to "mdw-nospam-justgviing@" "crap.justgiving" t)
110 (to "mdw-nospam-\\([^@]+\\)@" "crap.\\1" t)
111 (to "mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t)
112
113 ;; Regular nags.
114 (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot")
115 (from "\\<mailman-owner@" "nag.mailman" t)
116
117 ;; Uninteresting mail.
118 (from "expiry@letsencrypt\\.org" "spam.letsencrypt" t)
119
120 ;; Other splits I've not given a per-sender address.
121 (from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t)
122 (from "@amazon\\." "spam.amazon" t)
123 (from "@cineworldmail\\.com" "spam.cineworld" t)
124 (from "@picturehouses\\.co\\.uk" "spam.picturehouse" t)
125 (from "@nationwide" "spam.nationwide" t)
126 (from "@news\\.spotifymail\\.com" "spam.spotify" t)
127 (from "@action\\.openrightsgroup\\.org" "spam.org" t)
128 (from "unlimited@cineworld\\.com" "spam.cineworld" t)
129 (from "nationwide@securesuiteemail\\.com" "spam.nationwide" t)
130 (from "@liberty-human-rights\\.org\\.uk" "spam.liberty" t)
131 (from "@libertymail\\.org\\.uk" "spam.liberty" t)
132 (from "@openrightsgroup\\.org" "spam.org" t)
133 (from "@tshirthell\\.com" "spam.tshirt-hell" t)
134 (from "campaigns@jolla\\.com" "crap.jolla" t)
135
136 ;; Default.
137 "mail.misc")
138 nnimap-split-fancy nnmail-split-fancy)
139
140 ;;;----- That's all, folks --------------------------------------------------