* Re: would like inverse of bbdb/mail-auto-create-p
[not found] ` <ud6i54efq.fsf@att.net>
@ 2003-05-26 21:03 ` Michael R. Wolf
0 siblings, 0 replies; only message in thread
From: Michael R. Wolf @ 2003-05-26 21:03 UTC (permalink / raw)
Michael R. Wolf <MichaelRunningWolf@att.net> writes:
[...]
> Here's the working code....
[...]
With just one more tweak.
;;; It works.
;;; TODO -- remove the mapconcat addition of commas, that get removed by m-t-h
(defun wolf3-bbdb-add-recipients-to-bbdb ()
"Add all recipients to BBDB, using this list of headers:
from, sender,
to, cc, bcc,
resent-from, resent-to, resent-cc, resent-bcc."
(let ((fields '("from" "sender"
"to" "cc" "bcc"
"resent-from" "resent-to" "resent-cc" "resent-bcc")))
(mapc
(lambda (address)
(bbdb-annotate-message-sender address t t t))
(save-restriction
(message-narrow-to-headers)
(message-tokenize-header (mapconcat 'message-fetch-field fields ","))))))
;;; Could go into many hooks:
;;; message-send-mail-hook
;;; message-send-news-hook
;;; message-send-hook
;;; message-sent-hook
(add-hook 'message-send-hook 'wolf3-bbdb-add-recipients-to-bbdb)
--
Michael R. Wolf
All mammals learn by playing!
MichaelRunningWolf@att.net
^ permalink raw reply [flat|nested] only message in thread