From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49826 Path: main.gmane.org!not-for-mail From: Bill White Newsgroups: gmane.emacs.gnus.general Subject: spam-check-BBDB bug?/bbdb whitelist split function Date: Tue, 04 Feb 2003 22:15:31 -0600 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044418496 3441 80.91.224.249 (5 Feb 2003 04:14:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 5 Feb 2003 04:14:56 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18gGxa-0000tJ-00 for ; Wed, 05 Feb 2003 05:14:54 +0100 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 18gGyV-0000Hg-00; Tue, 04 Feb 2003 22:15:51 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 04 Feb 2003 22:16:48 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id WAA15502 for ; Tue, 4 Feb 2003 22:16:36 -0600 (CST) Original-Received: (qmail 32547 invoked by alias); 5 Feb 2003 04:15:35 -0000 Original-Received: (qmail 32542 invoked from network); 5 Feb 2003 04:15:34 -0000 Original-Received: from wri-dns0.wolfram.com (HELO wolfram.com) (140.177.205.10) by 66.230.238.6 with SMTP; 5 Feb 2003 04:15:34 -0000 Original-Received: from billwlx.wolfram.com.wolfram.com (dmz5.wolfram.com [140.177.205.1]) by wolfram.com (8.11.2/8.11.2) with ESMTP id h154FWf08211 for ; Tue, 4 Feb 2003 22:15:33 -0600 Original-To: ding X-Phone: 217-398-0700 x 234 X-Fax: 217-398-0747 X-Liturgical-Date: Weekday: Tuesday of the Fourth Week of Ordinary Time X-Face: $f^q=3W-VRc;w9na5Y.c-Jvu)M";y1O184tHjf@PP26MzCi.}7S^GP;QlJ$A3.PH|-`aQZ! d,*2d|f2z"9y%}r'$nhAO(9h`dv>,Mp\H6jf8AbuG>EZ,{u:cksL#NwCBoF<\;{QO+p32'(1*r"f-l baaB}uoEkv(o864LM@sH User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.3.50 (i586-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49826 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49826 I was futzing around defining my own "if he's in bbdb then he's not spam" split function when I discovered spam-check-BBDB in spam.el: ---------------------------------------------------------------------- (defun spam-check-BBDB () "Mail from people in the BBDB is never considered spam" (let ((who (message-fetch-field "from"))) (when who (setq who (regexp-quote (cadr (gnus-extract-address-components who)))) (if (bbdb-search-simple nil who) nil spam-split-group)))) ---------------------------------------------------------------------- It seems in my tests that bbdb-search-simple does not search for a regexp but for a simple string representation of an address, so I suspect the regexp-quote bit should be removed. I've also adjusted this to return a positive match for bbdb persons; folks who maintain bbdb as a whitelist might find it useful (adjust for local conditions, YMMV, etc.): ---------------------------------------------------------------------- (defun billw-BBDB-whitelist () "BBDB is a whitelist." (let ((who (message-fetch-field "from"))) (when who (setq who (cadr (gnus-extract-address-components who))) (if (bbdb-search-simple nil who) (format-time-string "mail.misc.%Y.%m") nil)))) (setq nnmail-split-fancy '(| ("to" ".*billw@wri\\.com" "spamtrap") ("List-Id" ".*gnucash-announce\\.lists\\.gnucash\\.org.*" "gnucash-announce") ("List-Id" ".*gnucash-user\\.lists\\.gnucash\\.org.*" "gnucash-user") ("List-Id" ".*gnucash-devel\\.lists\\.gnucash\\.org.*" "gnucash-devel") ("List-Id" ".*gnucash-patches\\.lists\\.gnucash\\.org.*" "gnucash-patches") ("List-ID" ".*developer list for mt\\.el.*" "mt-el") ;; [...] ;; my bbdb is a whitelist: save these (: billw-BBDB-whitelist) ;; check for scum (: spam-stat-split-fancy) ;; non-whitelist non-spam: save these (: (lambda nil (format-time-string "mail.misc.%Y.%m"))) )) ---------------------------------------------------------------------- Cheers - bw -- Bill White . billw@wolfram.com . http://members.wri.com/billw "No ma'am, we're musicians."