From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79205 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.gnus.general Subject: Re: checking several headers when splitting mail Date: Sun, 26 Jun 2011 21:26:25 +0200 Message-ID: References: <87zkliev2l.fsf@yun.yagibdah.de> <87tybcwh7h.fsf@yun.yagibdah.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1309116412 32422 80.91.229.12 (26 Jun 2011 19:26:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2011 19:26:52 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M27502@lists.math.uh.edu Sun Jun 26 21:26:48 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qauyk-0004On-0C for ding-account@gmane.org; Sun, 26 Jun 2011 21:26:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Qauya-0004AK-9K; Sun, 26 Jun 2011 14:26:36 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QauyY-0004AA-I6 for ding@lists.math.uh.edu; Sun, 26 Jun 2011 14:26:34 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1QauyV-0000rL-Rm for ding@lists.math.uh.edu; Sun, 26 Jun 2011 14:26:33 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QauyT-0000EV-1B for ding@gnus.org; Sun, 26 Jun 2011 21:26:29 +0200 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 48742188B5A8 for ; Sun, 26 Jun 2011 21:26:28 +0200 (CEST) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 994321C00057 for ; Sun, 26 Jun 2011 21:26:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id G2HMFV5HOoNO for ; Sun, 26 Jun 2011 21:26:26 +0200 (CEST) Original-Received: from igel.home (ppp-93-104-154-51.dynamic.mnet-online.de [93.104.154.51]) by mail.mnet-online.de (Postfix) with ESMTP for ; Sun, 26 Jun 2011 21:26:26 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id 276F7CA29C; Sun, 26 Jun 2011 21:26:26 +0200 (CEST) X-Yow: Mary Tyler Moore's SEVENTH HUSBAND is wearing my DACRON TANK TOP in a cheap hotel in HONOLULU! In-Reply-To: <87tybcwh7h.fsf@yun.yagibdah.de> (lee@yun.yagibdah.de's message of "Sun, 26 Jun 2011 21:00:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79205 Archived-At: lee writes: > To give an example: > > > (setq nnmail-split-fancy '(| > ;; some splitting rules can go here > > (& (from > "root@yun\\.yagibdah\\.de" > "mail.sys.yun") > ("Subject" > "/var/log/.*" > "mail.sys.yun")) > > ;; some more splitting rules can go here > ) > > > Above rule checks the from headers *and* the Subject: header and splits > mail into the mail.sys.yun group only when both the from headers and the > Subject: header matches. Except that it doesn't work like that: (& SPLIT...): Process each SPLIT expression. Thus the mail is stored into mail.sys.yun if From matches "root@..." *or* Subject matches "/var/log/...". If you want the mail to be delivered only when *both* conditions match, you need to nest the splits: (from "root@yun\\.yagibdah\\.de" ("Subject" "/var/log/.*" "mail.sys.yun")) (The | and & symbols should not be interpreted as logical operators, but rather as sequencing operators.) Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."