From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44147 Path: main.gmane.org!not-for-mail From: David Z Maze Newsgroups: gmane.emacs.gnus.general Subject: Re: bbdb and nnmail-split-fancy Date: Wed, 03 Apr 2002 19:49:17 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1017881472 3261 127.0.0.1 (4 Apr 2002 00:51:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 4 Apr 2002 00:51:12 +0000 (UTC) Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16svT5-0000qU-00 for ; Thu, 04 Apr 2002 02:51:11 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16svSB-00028n-00; Wed, 03 Apr 2002 18:50:15 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 03 Apr 2002 18:50:24 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id SAA10866 for ; Wed, 3 Apr 2002 18:50:12 -0600 (CST) Original-Received: (qmail 13247 invoked by alias); 4 Apr 2002 00:49:47 -0000 Original-Received: (qmail 13242 invoked from network); 4 Apr 2002 00:49:47 -0000 Original-Received: from pacific-carrier-annex.mit.edu (18.7.21.83) by gnus.org with SMTP; 4 Apr 2002 00:49:47 -0000 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id TAA01899 for ; Wed, 3 Apr 2002 19:49:46 -0500 (EST) Original-Received: from melbourne-city-street.mit.edu (MELBOURNE-CITY-STREET.MIT.EDU [18.7.21.86]) by central-city-carrier-station.mit.edu (8.9.2/8.9.2) with ESMTP id TAA00221; Wed, 3 Apr 2002 19:49:46 -0500 (EST) Original-Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73]) by melbourne-city-street.mit.edu (8.9.2/8.9.2) with ESMTP id TAA16832; Wed, 3 Apr 2002 19:49:18 -0500 (EST) Original-To: ding@gnus.org In-Reply-To: (Michael Cook's message of "Wed, 03 Apr 2002 17:58:43 -0500") Original-Lines: 59 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Artificial Intelligence, sparc-sun-solaris2.8) X-Attribution: DZM Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:44147 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:44147 Michael Cook writes: > does anyone know offhand how to get nnmail-split-fancy to pay > attention to what's in my bbdb address book? > that is, i want to say: > > if the message is addressed to me then > if the message is from someone in my address book > put the message into my inbox > else > put the message into the folder "other". My .gnus file has the following construct: (defun dzm-bbdb-split-fancy () "Create a fancy mail split according to bbdb rules. Look at entries in the bbdb. For every entry with a \"mail-group\" field, generate an appropriate split." (cons '& (apply 'nconc (mapcan (lambda (rec) (let ((nets (bbdb-record-net rec)) (group (bbdb-record-getprop rec 'mail-group))) (if group (cons (mapcar (lambda (net) (list 'any (regexp-quote net) group)) nets) nil)))) (bbdb-records))))) This looks rather Schemeful to me now, probably because I wrote it around the time I was taking 6.001, MIT's introductory computer science class, which apparently the esteemed Mr. Saklad hasn't had the benefit of. But the output of this can be dropped directly into nnmail-split-fancy, like so: (setq nnmail-split-fancy ;; Split to the first matching... `(| ;; Mailing lists... (& (any "ding@gnus\\.org" "mail.lists.ding") ;; etc. ) ;; Individuals we know of from bbdb ,(dzm-bbdb-split-fancy) ;; Personal mail (or not) (any "dmaze@.*mit\\.edu" "mail.misc.personal") "mail.misc.impersonal")) (Now, to figure out how to augment this recipe to use the new spam.el stuff...) -- David Maze dmaze@mit.edu http://www.mit.edu/~dmaze/ "Theoretical politics is interesting. Politicking should be illegal." -- Abra Mitchell