From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46493 Path: main.gmane.org!not-for-mail From: Jonas Steverud Newsgroups: gmane.emacs.gnus.general Subject: Re: Splitting and procmail Date: Wed, 11 Sep 2002 15:29:28 +0200 Organization: The Deciples of Albericht Nibelungen 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 1031751122 1295 127.0.0.1 (11 Sep 2002 13:32:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 11 Sep 2002 13:32:02 +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 17p7b4-0000Jw-00 for ; Wed, 11 Sep 2002 15:31:58 +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 17p7Yy-0006Z9-00; Wed, 11 Sep 2002 08:29:48 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 11 Sep 2002 08:30:24 -0500 (CDT) 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 IAA12399 for ; Wed, 11 Sep 2002 08:30:11 -0500 (CDT) Original-Received: (qmail 13555 invoked by alias); 11 Sep 2002 13:29:29 -0000 Original-Received: (qmail 13550 invoked from network); 11 Sep 2002 13:29:29 -0000 Original-Received: from osiris.medic.chalmers.se (HELO mail.dtek.chalmers.se) (129.16.30.197) by gnus.org with SMTP; 11 Sep 2002 13:29:29 -0000 Original-Received: from licia.dtek.chalmers.se (licia.dtek.chalmers.se [129.16.30.88]) by mail.dtek.chalmers.se (Postfix) with ESMTP id 44B433B233 for ; Wed, 11 Sep 2002 15:29:28 +0200 (MEST) Original-Received: (from d4jonas@localhost) by licia.dtek.chalmers.se (8.9.3/8.9.3) id PAA05946; Wed, 11 Sep 2002 15:29:28 +0200 (MEST) X-Authentication-Warning: licia.dtek.chalmers.se: d4jonas set sender to d4jonas@dtek.chalmers.se using -f Original-To: ding@gnus.org Mail-Copies-To: never In-Reply-To: (Jonas Steverud's message of "Tue, 10 Sep 2002 13:25:43 +0200") Original-Lines: 48 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46493 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46493 Jonas Steverud writes: [...] > Is it possible to have a split that checks the From and if a certain > regexp matches, a function is called that tests wheather the sender is a > member of BBDB and if not it is placed in "Spam", otherwise the next > rule is tested? After doing some searches in the archives and the 'Net as such, I've come up with the following function. I haven't tested it yet, so comments are more then welcome. I hope my example in the documentation string is correct. (defun js-gnus-split-if-not-in-bbdb (SPLIT) "If the sender is not within the BBDB, the function returns SPLIT, i.e. it is split to that group. SPLIT is a `nnmail-split-fancy' `split' construct - usually a string with a group name. To use BBDB as a white list for spam: nnmail-split-fancy ... \(| ... \(any \"\\\\(hotmail\\\\|msn\\\\|aol\\\\|yahoo\\\\|excite\\\\)\\.\\\\(co\\.uk\\\\|com\\\\|org\\\\)\" \(: js-gnus-split-if-not-in-bbdb \"Spam\"\) \) Handy togeather with very harsh spam filtering regexp's, like all mail from Hotmail, MSN, AOL et al. Place valid addresses in BBDB and all other mails will go to the spam group. Inspired by http://www.gnus.org/list-archives/ding/200204/msg00077.html. " (let ((from (message-fetch-field "from"))) (and from (let ((comp (condition-case () (mail-extract-address-components from) (error nil)))) (if (and comp (not (bbdb-search-simple (car comp) (cadr comp)))) SPLIT))))) -- ( www.dtek.chalmers.se/~d4jonas/ ! Wei Wu Wei ) ( Meaning of U2 Lyrics, Roleplaying ! To Do Without Do )