Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* 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

only message in thread, other threads:[~2003-05-26 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <u8ysv49pb.fsf@att.net>
     [not found] ` <wc38ysubvpe.fsf@gamma.cis.ohio-state.edu>
     [not found]   ` <uof1q38g3.fsf@att.net>
     [not found]     ` <wc3k7ce8slr.fsf@gamma.cis.ohio-state.edu>
     [not found]       ` <ur86mxksz.fsf@att.net>
     [not found]         ` <wc37k8d7b2m.fsf@gamma.cis.ohio-state.edu>
     [not found]           ` <ud6i54efq.fsf@att.net>
2003-05-26 21:03             ` would like inverse of bbdb/mail-auto-create-p Michael R. Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).