Merge branch 'master' of us:git/staging/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 ;;; 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 '(|
78 ;; Administrative boxes.
79 (to "\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t)
80 (to "\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t)
81 (to "\\(hostmaster\\)@" "admin.dns" t)
82 (to "\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t)
83 (to "\\(postmaster\\|spamd\\|mailer-daemon\\)@" "admin.mail" t)
84 (to "\\(irc\\|blight\\|ircbot\\)@" "admin.irc" t)
85 (to "\\(www\\|webmaster\\|mtos\\)@" "admin.web" t)
86 (to "\\(ftp\\|ftpadmin\\|mirror\\)@" "admin.ftp" t)
87 (to "\\(abuse\\|security\\)@" "admin.keep" 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 "bugs@distorted\\.org\\.uk" "admin.bugs")
92
93 ;; Colo provider.
94 (from "\\(accounts\\|support\\)@jump\\.net\\.uk" "keep.colo")
95
96 ;; Mailing lists, not split out earlier.
97 (to "python-list@python\\.org" "lists.python")
98 (to "jump-announce@jump\\.net\\.uk" "lists.jump-announce")
99
100 ;; Per-sender addresses.
101 (to "mdw-nospam-justgviing@" "crap.justgiving" t)
102 (to "mdw-nospam-\\([^@]+\\)@" "crap.\\1" t)
103 (to "mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t)
104
105 ;; Regular nags.
106 (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot")
107 (from "\\<mailman-owner@" "nag.mailman" t)
108
109 ;; Other splits I've not given a per-sender address.
110 (from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t)
111 (from "@amazon\\." "spam.amazon" t)
112 (from "@cineworldmail\\.com" "spam.cineworld" t)
113 (from "@picturehouses\\.co\\.uk" "spam.picturehouse" t)
114 (from "@nationwide" "spam.nationwide" t)
115 (from "@news\\.spotifymail\\.com" "spam.spotify" t)
116 (from "@action\\.openrightsgroup\\.org" "spam.org" t)
117 (from "unlimited@cineworld\\.com" "spam.cineworld" t)
118 (from "nationwide@securesuiteemail\\.com" "spam.nationwide" t)
119 (from "@liberty-human-rights\\.org\\.uk" "spam.liberty" t)
120 (from "@libertymail\\.org\\.uk" "spam.liberty" t)
121 (from "@openrightsgroup\\.org" "spam.org" t)
122 (from "@tshirthell\\.com" "spam.tshirt-hell" t)
123 (from "campaigns@jolla\\.com" "crap.jolla" t)
124
125 ;; Default.
126 "mail.misc")
127 nnimap-split-fancy nnmail-split-fancy)
128
129 ;;;----- That's all, folks --------------------------------------------------