Alexander Kotelnikov <[EMAIL PROTECTED]> writes:
> I have a buffer (right now it is gnus's " *nnmail incoming*") and I
> want a function to return me t if person who is in From header
> exists in bbdb and nil if he does not. What is the most right way to
> do this?
Here's my version of that, extracted from my .gnus file. I use
nnmail-fancy filters like:
(require 'bbdb-com) ;; so that bbdb-search will be defined for below
(setq
nnmail-split-fancy
'(|
;; ================ Assorted things to discard
;; ... lots of other filters ...
;; personal mail only gets through if sender appears in bbdb
(to "lawrence@\\(\\(shell\\.\\)?theworld\\|world\\.std\\)\\.com"
(: sdl-if-in-bbdb "personal"))
;; ...
)
)
(defun sdl-if-in-bbdb (target)
"gnus fancy split - if the senders address is in bbdb, return target
(let ((who (cadr (gnus-extract-address-components
(or (message-fetch-field "from")
(message-fetch-field "sender")
(message-fetch-field "reply-to")
"[EMAIL PROTECTED]"
))))
)
(message (concat "sdl-if-in-bbdb looking up " who))
(when (bbdb-search (bbdb-records) nil nil who)
target
)
)
)
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/