dot/emacs, dot/gnus-local.el.distorted: Some BBDB hacking.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 17 Mar 2016 10:32:11 +0000 (10:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 17 Mar 2016 10:32:11 +0000 (10:32 +0000)
dot/emacs
dot/gnus-local.el.distorted

index e1a5d6e..973690e 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 
 (or mdw-fast-startup
     (trap (bbdb-initialize 'gnus 'sendmail 'message)))
-(setq bbdb-north-american-phone-numbers-p nil)
+(setq bbdb-north-american-phone-numbers-p nil
+      bbdb/news-auto-create-p (lambda ()
+                               (string-match "^nnimap\\+"
+                                             gnus-newsgroup-name))
+      bbdb-user-mail-names
+      (concat "^"
+             "\\(" "\\(mdw\\|markw\\|root\\|postmaster\\)"
+                   "\\([-+][^@]*\\|\\)"
+                   "@\\(\\(dist\\|esc\\)orted\\.org\\.uk\\|odin\\.gg\\)"
+             "\\|" "distorted\\.mdw@g\\(\\|oogle\\)mail.com"
+             "\\|" "mwooding@\\(good\\|blackberry\\)\\.com"
+             "\\)$")
+      bbdb-canonicalize-net-hook
+      (lambda (addr)
+       (cond ((string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_"
+                                    "HTML-[0-9]+-[0-9]+-[0-9]+"
+                                    "@\\(nationwide-communications\\.co\\.uk\\)")
+                            addr)
+              (concat "nationwide@" (match-string 1 addr)))
+             (t addr))))
 
 ;; Customization.
 
index 02dea2e..b4b0037 100644 (file)
                (nnimap-address "mail.distorted.org.uk")
                (nnimap-stream tls)
                (nnimap-authinfo-file "~/.gnus.authinfo"))
+       (nnimap "markw-distorted"
+               (nnimap-address "mail.distorted.org.uk")
+               (nnimap-stream tls)
+               (nnimap-authinfo-file "~/.gnus.authinfo.markw"))
        (nnimap "google"
                (nnimap-address "imap.gmail.com")
                (nnimap-stream tls)
       "^nnimap\\+distorted:\\(crap\\|spam\\|admin\\|lists\\|nag\\)\\..*")
 
 ;; 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.