Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Cook <michael@waxrat.com>
Subject: Re: bbdb and nnmail-split-fancy
Date: Sat, 06 Apr 2002 02:07:32 -0500	[thread overview]
Message-ID: <g083cy9xq2z.fsf@zzz.cisco.com> (raw)
In-Reply-To: <g08r8lw1ja4.fsf@zzz.cisco.com> (Michael Cook's message of "Wed, 03 Apr 2002 17:58:43 -0500")

Michael Cook <michael@waxrat.com> writes:

> does anyone know offhand how to get nnmail-split-fancy to pay
> attention to what's in my bbdb address book?

ok, how about this:

(defun split-if-in-bbdb (field split)
  ;; FIELD is "from" or "to" or "cc".
  ;; SPLIT is an `nnmail-split-fancy' "split" construct.
  (let ((from (message-fetch-field field)))
    (and from
	 (let ((comp (condition-case ()
			 (mail-extract-address-components from)
		       (error nil))))
	   (and (bbdb-search-simple (car comp) (cadr comp))
		split)))))

then, in nnmail-split-fancy, something like this:

  (setq nnmail-split-fancy
        '(| ...
            (: split-if-in-bbdb "from" "inbox")
            "other"))

so, if the sender of the message is in your bbdb, then the message
gets split into your inbox folder.  otherwise, it gets split into
your "other" folder.

m.



  parent reply	other threads:[~2002-04-06  7:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-03 22:58 Michael Cook
2002-04-04  0:49 ` David Z Maze
2002-04-06  7:07 ` Michael Cook [this message]
2002-04-06  7:39 ` Jack Twilley
2002-04-06 17:20   ` Michael Cook
2002-04-06 20:46     ` Jack Twilley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=g083cy9xq2z.fsf@zzz.cisco.com \
    --to=michael@waxrat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).