Pages

Showing posts with label bbdb. Show all posts
Showing posts with label bbdb. Show all posts

Tuesday, September 14, 2010

Emailing or replying to someone using recipient specific from address


The BBDB can be used to store specific fields which tell Gnus which accounts to
use when posting to the recipient in the BBDB.





(defun DE-bbdb-match-field-recipient (field regexp)
"Match FIELD for recipient against REGEXP.
FIELD must be a symbol, e.g. 'email-type."

(debug)
(let (who rec)
(when (and
(gnus-buffer-live-p gnus-article-copy)
(setq who
(with-current-buffer gnus-article-copy
(save-restriction
(nnheader-narrow-to-headers)
(or (message-fetch-field "reply-to")
(message-fetch-field "from")))))
(setq rec
(bbdb-search-simple
nil
(cadr (gnus-extract-address-components who)))))
(string-match regexp (bbdb-get-field rec field)))))


;; by adding a bdbb field called "email-type" and setting it to "friend-alias"
;; this gnus-posting-style is met when replying to people. If posting from a group
;; with "friends" in the name ditto.
(add-to-list `gnus-posting-styles `((or (string-match ,(rx "friends") gnus-newsgroup-name) (DE-bbdb-match-field-recipient 'email-type "friend-alias"))
(from rgr/friends-email)
(name rgr/friends-name)
(organization nil)
(eval (setq mml2015-signers nil))
(signature-file "~/.emacs.d/.sigs/friends.sig")) t )




Tuesday, February 10, 2009

Splitting mail with BBDB and Gnus

I'm currently taking a lookt at splitting email using gnus. It would be a client side replacement for procmail. The advantage being ALL email downloaded at the server would be ing a single IMAP onbox so its's easier to see ALL from more limited clients, and that the splitting into seperate folders is more easily controlled using regexps on the Gnus client side. Anyway, more to come soon as I just got it working - here's the bookmark page:

http://www.emacswiki.org/emacs/SplitMailUsingBbdb

And, woohoo, I just got it working so that emails from BBDB entries tagged with gnus-private get stored in special folders as specified by that BBDB field. And all with IMAP. Wonderful stuff once more.