>> I have been using the bbdb for about two months now and I feel like
>> I am using it wrong.  I spend all my time tweaking the
>> bbdb-ignore-some-messages-alist for email addresses I don't want
>> noticed, to protect them from being automatically added (I have
>> that turned on for gnus mail groups).

Welcome, 1-millionth-person-with-this-problem!!  :-)

Noticing "most" messages is a good way for spammers to annoy you
twice, since their fake email addresses end up in your BBDB.  You also
get to collect a minimal amount of info for mailing list members with
whom you are likely to never correspond.  

Like many others, these got me to switch to noticing "some" messages.
However, that still gave me too much crap in my BBDB, so I switched to
this hybrid approach (see the docstring below).  To tell you the
truth, I can't remember if I wrote this (looks like it) or just
snagged it from the mailing list or someplace (I've been using it for
a long time), so sorry if there's an author that I can't credit.
-- 
[EMAIL PROTECTED] (WJCarpenter)    PGP 0x91865119
38 95 1B 69 C9 C6 3D 25    73 46 32 04 69 D6 ED F3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq bbdb/mail-auto-create-p 'bbdb-ignore-selected-messages-hook)
(setq bbdb-ignore-selected-messages-confirmation t)

(defvar bbdb-ignore-selected-messages-confirmation nil)

(defun bbdb-ignore-selected-messages-hook ()
  "For use as a bbdb/news-auto-create-hook or bbdb/mail-auto-create-hook.
This will automatically create BBDB entries for messages based on a
combination of bbdb-ignore-some-messages-alist and
bbdb-ignore-most-messages-alist.  It first looks at the SOME list.  If that
doesn't disqualify a message, then it looks at the MOST list.  If that
qualifies the message, the record is auto-created but, a confirmation
is conditionally sought, based on the value of 
bbdb-ingore-selected-messages-confirmation."
  (if (bbdb-ignore-some-messages-hook)
          ;; wasn't ruled out
          (if (bbdb-ignore-most-messages-hook)
                  ;; was ruled in
                  (if bbdb-ignore-selected-messages-confirmation
                          (let ((case-fold-search t)
                                        (marker (bbdb-header-start))
                                        record-exists from)
                                (save-excursion
                                  (set-buffer (marker-buffer marker))
                                  (save-restriction
                                        (widen)
                                        (goto-char marker)
                                        (setq from (bbdb-extract-field-value "FROM"))))
                                (setq record-exists (bbdb-annotate-message-sender 
from))
                                (or record-exists
                                        (y-or-n-p (concat "Create BBDB record from " 
from "? "))))
                        ;; no confirmation desired so let it be
                        t
                        )
                nil
                )
        nil
        ))

_______________________________________________
bbdb-info mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/bbdb-info

Reply via email to