Commit | Line | Data |
---|---|---|
5252f79a MW |
1 | ;;; -*-emacs-lisp-*- |
2 | ;;; | |
3 | ;;; Local GNUS configuration -- distorted.org.uk version | |
4 | ;;; | |
5 | ;;; (c) 2014 Mark Wooding | |
6 | ;;; | |
7 | ||
8 | ;;;-------------------------------------------------------------------------- | |
789a48fe MW |
9 | ;;; How to send mail. |
10 | ||
24da4184 MW |
11 | (setq smtpmail-smtp-service 587 |
12 | smtpmail-auth-credentials "~/.gnus.authinfo") | |
13 | ||
14 | (setq mdw-send-mail-alist | |
15 | `((distorted-smtp | |
16 | (send-mail-function . smtpmail-send-it) | |
17 | (smtpmail-smtp-server . "mail.distorted.org.uk") | |
18 | (smtpmail-starttls-credentials | |
19 | ("mail.distorted.org.uk" 587 nil nil))) | |
20 | (chiark-smtp | |
21 | (send-mail-function . smtpmail-send-it) | |
22 | (smtpmail-smtp-server . "smtp.dovecot.chiark.greenend.org.uk") | |
23 | (starttls-extra-arguments "--insecure") | |
24 | (smtpmail-starttls-credentials | |
25 | ("smtp.dovecot.chiark.greenend.org.uk" 587 nil nil))) | |
26 | (gmail-smtp | |
27 | (send-mail-function . smtpmail-send-it) | |
28 | (smtpmail-smtp-server . "smtp.gmail.com") | |
29 | (smtpmail-starttls-credentials | |
30 | ("smtp.gmail.com" 587 nil nil)))) | |
31 | mdw-guess-send-mail-alist | |
32 | `((,(concat "@\\(" "\\(chiark\\|slimy\\|coriolis\\)" | |
33 | "\\.greenend\\.org\\.uk" | |
34 | "\\|" "evade\\.org\\.uk" | |
35 | "\\|" "fyvzl\\.net" | |
36 | "\\)$") . chiark-smtp) | |
37 | ("@g\\(\\|oogle\\)mail\\.com$" . gmail-smtp)) | |
38 | mdw-default-send-mail-method nil) | |
789a48fe MW |
39 | |
40 | ;;;-------------------------------------------------------------------------- | |
f240cfd7 MW |
41 | ;;; News via chiark. |
42 | ||
43 | ;; Currently we assume an SSH tunnel. This will be fixed later. | |
44 | (setq gnus-select-method | |
45 | '(nntp "chiark-ssh-kludge" | |
46 | (nntp-open-connection-function nntp-open-authinfo-kludge) | |
df38b85d MW |
47 | (nntp-address "tunnel.chiark.greenend.org.uk") |
48 | (nntp-authinfo-generic "md5cookie1way mdw"))) | |
f240cfd7 MW |
49 | |
50 | ;;;-------------------------------------------------------------------------- | |
5252f79a MW |
51 | ;;; Where we get mail from. |
52 | ||
53 | ;; Read mail on the IMAP server. | |
54 | (setq gnus-secondary-select-methods | |
55 | '((nnimap "distorted" | |
56 | (nnimap-address "mail.distorted.org.uk") | |
57 | (nnimap-stream tls) | |
9adf6847 | 58 | (nnimap-authinfo-file "~/.gnus.authinfo")) |
43026cf3 MW |
59 | (nnimap "markw-distorted" |
60 | (nnimap-address "mail.distorted.org.uk") | |
61 | (nnimap-stream tls) | |
62 | (nnimap-authinfo-file "~/.gnus.authinfo.markw")) | |
0191c356 MW |
63 | (nnimap "mwooding-chiark" |
64 | (nnimap-address "imap.dovecot.chiark.greenend.org.uk") | |
65 | (nnimap-stream tls) | |
66 | (nnimap-authinfo-file "~/.gnus.authinfo")) | |
9adf6847 MW |
67 | (nnimap "google" |
68 | (nnimap-address "imap.gmail.com") | |
69 | (nnimap-stream tls) | |
5252f79a MW |
70 | (nnimap-authinfo-file "~/.gnus.authinfo")))) |
71 | ||
72 | ;; Send sent mail back to me. | |
73 | (setq gnus-message-archive-method "mail" | |
74 | gnus-gcc-mark-as-read t | |
75 | gnus-message-archive-group "nnimap+distorted:mail.sent") | |
76 | ||
77 | ;;;-------------------------------------------------------------------------- | |
78 | ;;; Mail group configuration. | |
79 | ||
80 | ;; General splitting configuration. | |
81 | (setq nnimap-split-inbox '("INBOX" "to.split") | |
82 | nnimap-split-rule 'nnimap-split-fancy | |
4fb653fd MW |
83 | nnimap-split-methods 'nnimap-split-fancy |
84 | nnmail-split-methods 'nnmail-split-fancy | |
5252f79a | 85 | nnimap-split-predicate "UNDELETED" |
4fb653fd MW |
86 | nnimap-split-crosspost t |
87 | nnmail-split-crosspost t | |
5252f79a MW |
88 | nnmail-split-fancy-match-partial-words nil) |
89 | ||
90 | ;; Automatic expiry for particular groups. | |
91 | (setq gnus-auto-expirable-newsgroups | |
40a3fc1d MW |
92 | (concat "^" |
93 | "\\(nnimap\\+[^:]+\\|nnvirtual\\):" | |
94 | "\\(admin\\|crap\\|lists\\|nag\\|spam\\)\\.")) | |
5252f79a | 95 | |
277521fa | 96 | ;; My various email addresses. |
43026cf3 | 97 | (setq message-alternative-emails bbdb-user-mail-names |
277521fa MW |
98 | message-dont-reply-to-names message-alternative-emails) |
99 | ||
5252f79a MW |
100 | ;; Mail sent to `mdw-nospam-THING' should appear to come from this address. |
101 | (setq gnus-posting-styles | |
63bc8fd4 MW |
102 | '(("^nnimap\\+distorted:crap\\." |
103 | (address (concat "mdw-nospam-" | |
104 | (substring gnus-newsgroup-name (match-end 0)) | |
24da4184 MW |
105 | "@distorted.org.uk"))) |
106 | ("^nnimap\\+[^:]+-chiark:" | |
107 | ("X-mdw-Send-Mail" "chiark-smtp")) | |
108 | ("^nnimap\\+google:" | |
109 | (address "distorted.mdw@gmail.com") | |
110 | ("X-mdw-Send-Mail" "gmail-smtp")))) | |
5252f79a MW |
111 | |
112 | ;; The actual splitting rules. | |
4fb653fd | 113 | (setq nnmail-split-fancy |
a27bd871 MW |
114 | '(| |
115 | ;; Administrative boxes. | |
116 | (to "\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t) | |
117 | (to "\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t) | |
118 | (to "\\(hostmaster\\)@" "admin.dns" t) | |
119 | (to "\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t) | |
120 | (to "\\(postmaster\\|spamd\\|mailer-daemon\\)@" "admin.mail" t) | |
121 | (to "\\(irc\\|blight\\|ircbot\\)@" "admin.irc" t) | |
122 | (to "\\(www\\|webmaster\\|mtos\\)@" "admin.web" t) | |
123 | (to "\\(ftp\\|ftpadmin\\|mirror\\)@" "admin.ftp" t) | |
124 | (to "\\(abuse\\|security\\)@" "admin.keep" t) | |
125 | (from "cron daemon" "admin.misc") | |
126 | (from "uucp@distorted\\.org\\.uk" "admin.uucp") | |
127 | (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc") | |
d268047a | 128 | (from "bugs@distorted\\.org\\.uk" "admin.bugs") |
a27bd871 MW |
129 | |
130 | ;; Colo provider. | |
131 | (from "\\(accounts\\|support\\)@jump\\.net\\.uk" "keep.colo") | |
132 | ||
133 | ;; Mailing lists, not split out earlier. | |
5252f79a | 134 | (to "python-list@python\\.org" "lists.python") |
a27bd871 MW |
135 | (to "jump-announce@jump\\.net\\.uk" "lists.jump-announce") |
136 | ||
137 | ;; Per-sender addresses. | |
370bb0ff | 138 | (to "mdw-nospam-justgviing@" "crap.justgiving" t) |
5252f79a | 139 | (to "mdw-nospam-\\([^@]+\\)@" "crap.\\1" t) |
370bb0ff | 140 | (to "mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t) |
a27bd871 MW |
141 | |
142 | ;; Regular nags. | |
5252f79a MW |
143 | (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot") |
144 | (from "\\<mailman-owner@" "nag.mailman" t) | |
a27bd871 | 145 | |
48c5ccb3 MW |
146 | ;; Uninteresting mail. |
147 | (from "expiry@letsencrypt\\.org" "spam.letsencrypt" t) | |
148 | ||
a27bd871 | 149 | ;; Other splits I've not given a per-sender address. |
5252f79a MW |
150 | (from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t) |
151 | (from "@amazon\\." "spam.amazon" t) | |
152 | (from "@cineworldmail\\.com" "spam.cineworld" t) | |
153 | (from "@picturehouses\\.co\\.uk" "spam.picturehouse" t) | |
154 | (from "@nationwide" "spam.nationwide" t) | |
155 | (from "@news\\.spotifymail\\.com" "spam.spotify" t) | |
156 | (from "@action\\.openrightsgroup\\.org" "spam.org" t) | |
157 | (from "unlimited@cineworld\\.com" "spam.cineworld" t) | |
158 | (from "nationwide@securesuiteemail\\.com" "spam.nationwide" t) | |
a66127fb MW |
159 | (from "@liberty-human-rights\\.org\\.uk" "spam.liberty" t) |
160 | (from "@libertymail\\.org\\.uk" "spam.liberty" t) | |
a66127fb | 161 | (from "@openrightsgroup\\.org" "spam.org" t) |
5252f79a | 162 | (from "@tshirthell\\.com" "spam.tshirt-hell" t) |
a27bd871 MW |
163 | (from "campaigns@jolla\\.com" "crap.jolla" t) |
164 | ||
165 | ;; Default. | |
4fb653fd MW |
166 | "mail.misc") |
167 | nnimap-split-fancy nnmail-split-fancy) | |
5252f79a MW |
168 | |
169 | ;;;----- That's all, folks -------------------------------------------------- |