;;; (c) 2014 Mark Wooding
;;;
+(setq auth-sources '("~/.gnus.authinfo"))
+
;;;--------------------------------------------------------------------------
;;; How to send mail.
-(and nil
- (setq smtpmail-smtp-server "mail.distorted.org.uk"
- smtpmail-sendto-domain "distorted.org.uk"
- smtpmail-smtp-service 587
- smtpmail-auth-credentials "~/.gnus.authinfo"
- message-send-mail-function 'smtpmail-send-it
- smtpmail-starttls-credentials
- '(("mail.distorted.org.uk" 587 "" ""))))
+(setq smtpmail-smtp-service 587
+ smtpmail-auth-credentials "~/.gnus.authinfo")
+
+(setq mdw-send-mail-alist
+ `((distorted-smtp
+ (send-mail-function . smtpmail-send-it)
+ (smtpmail-smtp-server . "mail.distorted.org.uk")
+ (smtpmail-starttls-credentials
+ ("mail.distorted.org.uk" 587 nil nil)))
+ (chiark-smtp
+ (send-mail-function . smtpmail-send-it)
+ (smtpmail-smtp-server . "smtp.dovecot.chiark.greenend.org.uk")
+ (starttls-extra-arguments "--insecure")
+ (smtpmail-starttls-credentials
+ ("smtp.dovecot.chiark.greenend.org.uk" 587 nil nil)))
+ (gmail-smtp
+ (send-mail-function . smtpmail-send-it)
+ (smtpmail-smtp-server . "smtp.gmail.com")
+ (smtpmail-starttls-credentials
+ ("smtp.gmail.com" 587 nil nil))))
+ mdw-guess-send-mail-alist
+ `((,(concat "@\\(" "\\(chiark\\|slimy\\|coriolis\\)"
+ "\\.greenend\\.org\\.uk"
+ "\\|" "evade\\.org\\.uk"
+ "\\|" "fyvzl\\.net"
+ "\\)$") . chiark-smtp)
+ ("@g\\(\\|oogle\\)mail\\.com$" . gmail-smtp))
+ mdw-default-send-mail-method nil)
+
+;;;--------------------------------------------------------------------------
+;;; News via chiark.
+
+;; Currently we assume an SSH tunnel. This will be fixed later.
+(setq gnus-select-method
+ '(nntp "chiark-ssh-kludge"
+ (nntp-open-connection-function nntp-open-authinfo-kludge)
+ (nntp-address "tunnel.chiark.greenend.org.uk")
+ (nntp-authinfo-generic "md5cookie1way mdw")))
;;;--------------------------------------------------------------------------
;;; Where we get mail from.
(setq gnus-secondary-select-methods
'((nnimap "distorted"
(nnimap-address "mail.distorted.org.uk")
- (nnimap-stream tls)
- (nnimap-authinfo-file "~/.gnus.authinfo"))
+ (nnimap-stream starttls)
+ (nnimap-inbox "INBOX")
+ (nnimap-unsplittable-articles (%Deleted)))
+ (nnimap "markw-distorted"
+ (nnimap-address "mail.distorted.org.uk")
+ (nnimap-stream starttls)
+ (nnimap-inbox "INBOX")
+ (nnimap-unsplittable-articles (%Deleted)))
+ (nnimap "mwooding-chiark"
+ (nnimap-address "imap.dovecot.chiark.greenend.org.uk")
+ (nnimap-stream starttls)
+ (starttls-extra-arguments ("--insecure"))
+ (nnimap-inbox "INBOX")
+ (nnimap-unsplittable-articles (%Deleted)))
(nnimap "google"
(nnimap-address "imap.gmail.com")
(nnimap-stream tls)
- (nnimap-authinfo-file "~/.gnus.authinfo"))))
+ (nnimap-inbox "INBOX")
+ (nnimap-unsplittable-articles (%Deleted)))))
;; Send sent mail back to me.
(setq gnus-message-archive-method "mail"
;; Automatic expiry for particular groups.
(setq gnus-auto-expirable-newsgroups
- "^nnimap\\+distorted:\\(crap\\|spam\\|admin\\|lists\\|nag\\)\\..*")
+ (concat "^"
+ "\\(nnimap\\+[^:]+\\|nnvirtual\\):"
+ "\\(admin\\|crap\\|lists\\|nag\\|spam\\)\\."))
;; My various email addresses.
-(setq message-alternative-emails
- (concat "^"
- "\\(" "\\(mdw\\|markw\\|postmaster\\)"
- "\\([-+][^@]*\\|\\)"
- "@\\(distorted\\.org\\.uk\\|escorted\\.org\\.uk\\|odin\\.gg\\)"
- "\\|" "distorted\\.mdw@g\\(oogle\\|\\)mail\\.com"
- "\\)$")
+(setq message-alternative-emails bbdb-user-mail-names
message-dont-reply-to-names message-alternative-emails)
;; Mail sent to `mdw-nospam-THING' should appear to come from this address.
(setq gnus-posting-styles
- '(((and (string-match "^nnimap\\+distorted:crap\\.\\(.*\\)$"
- gnus-newsgroup-name)
- (setq mdw-from-address
- (replace-match "mdw-nospam-\\1@distorted.org.uk"
- nil nil gnus-newsgroup-name)))
- ("From" mdw-from-address))))
+ '(("^nnimap\\+distorted:crap\\."
+ (address (concat "mdw-nospam-"
+ (substring gnus-newsgroup-name (match-end 0))
+ "@distorted.org.uk")))
+ ("^nnimap\\+[^:]+-chiark:"
+ ("X-mdw-Send-Mail" "chiark-smtp"))
+ ("^nnimap\\+google:"
+ (address "distorted.mdw@gmail.com")
+ ("X-mdw-Send-Mail" "gmail-smtp"))))
;; The actual splitting rules.
(setq nnmail-split-fancy
(from "cron daemon" "admin.misc")
(from "uucp@distorted\\.org\\.uk" "admin.uucp")
(from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc")
+ (from "support@aa\\.net\\.uk" "admin.aaisp")
(from "bugs@distorted\\.org\\.uk" "admin.bugs")
;; Colo provider.
(from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot")
(from "\\<mailman-owner@" "nag.mailman" t)
+ ;; Uninteresting mail.
+ (from "expiry@letsencrypt\\.org" "spam.letsencrypt" t)
+
;; Other splits I've not given a per-sender address.
(from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t)
(from "@amazon\\." "spam.amazon" t)