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 | ||
6dac28f9 MW |
8 | ;;;-------------------------------------------------------------------------- |
9 | ;;; Random configuration. | |
10 | ||
df5a4ca5 MW |
11 | (setq auth-sources '("~/.gnus.authinfo")) |
12 | ||
ae7fb192 MW |
13 | (remove-hook 'gnus-mark-article-hook |
14 | 'gnus-summary-mark-read-and-unread-as-read) | |
15 | (add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read) | |
16 | ||
31b2b432 MW |
17 | (setq gnus-level-unsubscribed 6) |
18 | ||
5252f79a | 19 | ;;;-------------------------------------------------------------------------- |
789a48fe MW |
20 | ;;; How to send mail. |
21 | ||
24da4184 MW |
22 | (setq smtpmail-smtp-service 587 |
23 | smtpmail-auth-credentials "~/.gnus.authinfo") | |
24 | ||
25 | (setq mdw-send-mail-alist | |
26 | `((distorted-smtp | |
27 | (send-mail-function . smtpmail-send-it) | |
28 | (smtpmail-smtp-server . "mail.distorted.org.uk") | |
29 | (smtpmail-starttls-credentials | |
30 | ("mail.distorted.org.uk" 587 nil nil))) | |
31 | (chiark-smtp | |
32 | (send-mail-function . smtpmail-send-it) | |
33 | (smtpmail-smtp-server . "smtp.dovecot.chiark.greenend.org.uk") | |
34 | (starttls-extra-arguments "--insecure") | |
35 | (smtpmail-starttls-credentials | |
36 | ("smtp.dovecot.chiark.greenend.org.uk" 587 nil nil))) | |
37 | (gmail-smtp | |
38 | (send-mail-function . smtpmail-send-it) | |
39 | (smtpmail-smtp-server . "smtp.gmail.com") | |
40 | (smtpmail-starttls-credentials | |
41 | ("smtp.gmail.com" 587 nil nil)))) | |
42 | mdw-guess-send-mail-alist | |
43 | `((,(concat "@\\(" "\\(chiark\\|slimy\\|coriolis\\)" | |
44 | "\\.greenend\\.org\\.uk" | |
45 | "\\|" "evade\\.org\\.uk" | |
46 | "\\|" "fyvzl\\.net" | |
47 | "\\)$") . chiark-smtp) | |
48 | ("@g\\(\\|oogle\\)mail\\.com$" . gmail-smtp)) | |
49 | mdw-default-send-mail-method nil) | |
789a48fe MW |
50 | |
51 | ;;;-------------------------------------------------------------------------- | |
f240cfd7 MW |
52 | ;;; News via chiark. |
53 | ||
54 | ;; Currently we assume an SSH tunnel. This will be fixed later. | |
55 | (setq gnus-select-method | |
56 | '(nntp "chiark-ssh-kludge" | |
57 | (nntp-open-connection-function nntp-open-authinfo-kludge) | |
df38b85d MW |
58 | (nntp-address "tunnel.chiark.greenend.org.uk") |
59 | (nntp-authinfo-generic "md5cookie1way mdw"))) | |
f240cfd7 MW |
60 | |
61 | ;;;-------------------------------------------------------------------------- | |
5252f79a MW |
62 | ;;; Mail group configuration. |
63 | ||
64 | ;; General splitting configuration. | |
90ad62cd | 65 | (setq nnimap-split-rule 'nnimap-split-fancy |
4fb653fd | 66 | nnmail-split-methods 'nnmail-split-fancy |
5252f79a | 67 | nnimap-split-predicate "UNDELETED" |
4fb653fd MW |
68 | nnimap-split-crosspost t |
69 | nnmail-split-crosspost t | |
5252f79a MW |
70 | nnmail-split-fancy-match-partial-words nil) |
71 | ||
72 | ;; Automatic expiry for particular groups. | |
73 | (setq gnus-auto-expirable-newsgroups | |
40a3fc1d MW |
74 | (concat "^" |
75 | "\\(nnimap\\+[^:]+\\|nnvirtual\\):" | |
9ee82fbb | 76 | "\\(" "\\(admin\\|crap\\|lists\\|nag\\)\\." |
9dbc618b MW |
77 | "\\|" "spam\\.oubliette" |
78 | "\\)")) | |
5252f79a | 79 | |
277521fa | 80 | ;; My various email addresses. |
43026cf3 | 81 | (setq message-alternative-emails bbdb-user-mail-names |
277521fa MW |
82 | message-dont-reply-to-names message-alternative-emails) |
83 | ||
5252f79a MW |
84 | ;; Mail sent to `mdw-nospam-THING' should appear to come from this address. |
85 | (setq gnus-posting-styles | |
63bc8fd4 MW |
86 | '(("^nnimap\\+distorted:crap\\." |
87 | (address (concat "mdw-nospam-" | |
88 | (substring gnus-newsgroup-name (match-end 0)) | |
24da4184 MW |
89 | "@distorted.org.uk"))) |
90 | ("^nnimap\\+[^:]+-chiark:" | |
91 | ("X-mdw-Send-Mail" "chiark-smtp")) | |
92 | ("^nnimap\\+google:" | |
93 | (address "distorted.mdw@gmail.com") | |
94 | ("X-mdw-Send-Mail" "gmail-smtp")))) | |
5252f79a | 95 | |
093f5ffa MW |
96 | (defvar mdw-odin-parse-regexp |
97 | (concat "^" | |
98 | "\\S-+" "\\s-+" ; time limit | |
99 | "\\(" "\\S-+" "\\)" "\\s-+" ; local part | |
100 | "\\S-+" "\\s-+" ; recipient email address | |
101 | "=" "\\(" "\\S-+" "\\)" ; mailbox tag | |
102 | "\\(" "$" "\\|" "\\s-" "\\)")) | |
103 | ||
104 | (defun mdw-odin-splits () | |
105 | (let ((list nil)) | |
106 | (with-temp-buffer | |
107 | (call-process "ssh" nil t nil | |
108 | "stratocaster" "userv" "odin" "mail" "list") | |
109 | (goto-char (point-min)) | |
110 | (while (< (point) (point-max)) | |
111 | (when (looking-at mdw-odin-parse-regexp) | |
112 | (let ((local-part (match-string 1)) | |
113 | (tag (match-string 2))) | |
114 | (push `(to ,(format "%s@odin\\.gg" local-part) | |
115 | ,(format "crap.%s" tag)) | |
116 | list))) | |
117 | (forward-line))) | |
118 | (nreverse list))) | |
119 | ||
5252f79a | 120 | ;; The actual splitting rules. |
4fb653fd | 121 | (setq nnmail-split-fancy |
093f5ffa | 122 | `(| |
a27bd871 | 123 | ;; Administrative boxes. |
a93d1938 MW |
124 | (to "\\<\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t) |
125 | (to "\\<\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t) | |
126 | (to "\\<\\(hostmaster\\)@" "admin.dns" t) | |
127 | (to "\\<\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t) | |
128 | (to "\\<\\(postmaster\\|spamd\\|mailer-daemon\\)@" "admin.mail" t) | |
129 | (to "\\<\\(irc\\|blight\\|ircbot\\)@" "admin.irc" t) | |
130 | (to "\\<\\(www\\|webmaster\\|mtos\\)@" "admin.web" t) | |
131 | (to "\\<\\(ftp\\|ftpadmin\\|mirror\\)@" "admin.ftp" t) | |
132 | (to "\\\<\\(abuse\\|security\\)@" "admin.keep" t) | |
a27bd871 MW |
133 | (from "cron daemon" "admin.misc") |
134 | (from "uucp@distorted\\.org\\.uk" "admin.uucp") | |
135 | (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc") | |
51fb1b09 | 136 | (from "support@aa\\.net\\.uk" "admin.aaisp") |
d268047a | 137 | (from "bugs@distorted\\.org\\.uk" "admin.bugs") |
a27bd871 MW |
138 | |
139 | ;; Colo provider. | |
140 | (from "\\(accounts\\|support\\)@jump\\.net\\.uk" "keep.colo") | |
141 | ||
142 | ;; Mailing lists, not split out earlier. | |
5252f79a | 143 | (to "python-list@python\\.org" "lists.python") |
3a268ef9 MW |
144 | (to "\\(jump-\\(announce\\|discuss\\)\\)@\\(lists\\.\\)jump\\.net\\.uk" |
145 | "lists.jump-\\1") | |
272f4216 MW |
146 | (to "cambridgecryptowhiskyclub@gmail\\.com" |
147 | "lists.cambridge-crypto-whisky") | |
10e55928 MW |
148 | (from "@liberty-human-rights\\.org\\.uk\\>" "lists.liberty" t) |
149 | (from "@libertymail\\.org\\.uk\\>" "lists.liberty" t) | |
150 | (from "@openrightsgroup\\.org\\>" "lists.org" t) | |
a27bd871 MW |
151 | |
152 | ;; Per-sender addresses. | |
a93d1938 MW |
153 | (to "\\<mdw-nospam-justgviing@" "crap.justgiving" t) |
154 | (to "\\<mdw-nospam-\\([^@]+\\)@" "crap.\\1" t) | |
155 | (to "\\<mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t) | |
a27bd871 | 156 | |
093f5ffa MW |
157 | (to "\\(markw\\|mdw\\|mw\\)@odin\\.gg" "mail.misc") |
158 | ,@(mdw-odin-splits) | |
159 | (to "\\([a-z0-9]+\\)@odin\\.gg" "crap.odin-misc") | |
160 | ||
a27bd871 | 161 | ;; Regular nags. |
5252f79a MW |
162 | (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot") |
163 | (from "\\<mailman-owner@" "nag.mailman" t) | |
a27bd871 | 164 | |
48c5ccb3 | 165 | ;; Uninteresting mail. |
10e55928 | 166 | (from "expiry@letsencrypt\\.org" "admin.letsencrypt") |
48c5ccb3 | 167 | |
a27bd871 | 168 | ;; Other splits I've not given a per-sender address. |
10e55928 MW |
169 | (from "@\\(.*\\.\\)?lovefilm\\.com\\>" "crap.lovefilm" t) |
170 | (from "@\\(\\|.*\\.\\)amazon\\." "crap.amazon" t) | |
171 | (from "@cineworldmail\\.com\\>" "crap.cineworld" t) | |
172 | (from "@picturehouses\\.co\\.uk\\>" "crap.picturehouse" t) | |
173 | (from "@nationwide" "crap.nationwide" t) | |
174 | (from "nationwide@securesuiteemail\\.com\\>" "crap.nationwide" t) | |
175 | (from "@news\\.spotifymail\\.com\\>" "crap.spotify" t) | |
176 | (from "@action\\.openrightsgroup\\.org\\>" "crap.org" t) | |
177 | (from "unlimited@cineworld\\.com\\>" "crap.cineworld" t) | |
178 | (from "@tshirthell\\.com\\>" "crap.tshirt-hell" t) | |
a93d1938 | 179 | (from "campaigns@jolla\\.com\\>" "crap.jolla" t) |
a27bd871 MW |
180 | |
181 | ;; Default. | |
90ad62cd | 182 | "mail.misc")) |
5252f79a | 183 | |
c77d8eb0 MW |
184 | ;;;-------------------------------------------------------------------------- |
185 | ;;; Where we get mail from. | |
186 | ||
187 | ;; Read mail on the IMAP server. | |
188 | (setq gnus-secondary-select-methods | |
90ad62cd | 189 | `((nnimap "distorted" |
c77d8eb0 MW |
190 | (nnimap-address "mail.distorted.org.uk") |
191 | (nnimap-stream starttls) | |
90ad62cd MW |
192 | (nnimap-inbox ("INBOX" "to.split")) |
193 | (nnimap-split-methods nnimap-split-fancy) | |
194 | (nnimap-split-fancy ,nnmail-split-fancy) | |
c77d8eb0 MW |
195 | (nnimap-unsplittable-articles (%Deleted))) |
196 | (nnimap "markw-distorted" | |
197 | (nnimap-address "mail.distorted.org.uk") | |
198 | (nnimap-stream starttls) | |
90ad62cd MW |
199 | (nnimap-inbox ("INBOX" "to.split")) |
200 | (nnimap-split-methods nnimap-split-fancy) | |
201 | (nnimap-split-fancy ,nnmail-split-fancy) | |
c77d8eb0 MW |
202 | (nnimap-unsplittable-articles (%Deleted))) |
203 | (nnimap "mwooding-chiark" | |
204 | (nnimap-address "imap.dovecot.chiark.greenend.org.uk") | |
205 | (nnimap-stream starttls) | |
c77d8eb0 MW |
206 | (nnimap-inbox "INBOX") |
207 | (nnimap-unsplittable-articles (%Deleted))) | |
208 | (nnimap "google" | |
209 | (nnimap-address "imap.gmail.com") | |
210 | (nnimap-stream tls) | |
211 | (nnimap-inbox "INBOX") | |
212 | (nnimap-unsplittable-articles (%Deleted))))) | |
213 | ||
214 | ;; Send sent mail back to me. | |
215 | (setq gnus-message-archive-method "mail" | |
216 | gnus-gcc-mark-as-read t | |
217 | gnus-message-archive-group "nnimap+distorted:mail.sent") | |
218 | ||
5252f79a | 219 | ;;;----- That's all, folks -------------------------------------------------- |