Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7E2E0431FD0 for ; Tue, 22 Feb 2011 18:28:45 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 3.433 X-Spam-Level: *** X-Spam-Status: No, score=3.433 tagged_above=-999 required=5 tests=[DATE_IN_PAST_96_XX=2.07, RDNS_DYNAMIC=0.363, TO_NO_BRKTS_DYNIP=1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u0R2qhhbvA1q for ; Tue, 22 Feb 2011 18:28:44 -0800 (PST) Received: from hackervisions.org (67-207-143-141.slicehost.net [67.207.143.141]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7B2DB431FB5 for ; Tue, 22 Feb 2011 18:28:44 -0800 (PST) Received: from ool-18bd39a4.dyn.optonline.net ([24.189.57.164] helo=localhost) by hackervisions.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Ps3oo-0007sV-UK; Tue, 22 Feb 2011 20:47:07 -0500 From: James Vasile To: Daniel Barlow , notmuch@notmuchmail.org Subject: Re: Spam and mailing list filtering? In-Reply-To: <87ei7ggjx4.fsf@lsip.4a.telent.net> References: <87ei7ggjx4.fsf@lsip.4a.telent.net> User-Agent: Notmuch/0.3.1 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 17 Feb 2011 08:37:45 -0500 Message-ID: <87sjvmeq8m.fsf@hackervisions.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2011 02:28:45 -0000 On Thu, 10 Feb 2011 12:20:55 +0000, Daniel Barlow wrote: > 1) (How) can I filter on the X-Spam-Bar header to chop out spam and > suspected spam? I just integrated Spambayes into my notmuch toolchain. It's crude, but here's how it works: My script does `find -mtime 0 | xargs grep -L ^X-Spambayes-Classification` to get all the recent files that aren't already classified by spambayes. It passes them to spambayes, overwrites the mail file with the resulting mail (with spambayes header) and then does `notmuch tag +spambayes id:$ID` for anythat come back with "X-Spambayes-Classification: spam". I suppose that in doing this I might leave myself open to spammers that pre-seed emails with "X-Spambayes-Classification: ham" tags, but I searched my mail archives and no messages came with those headers already in place. You could do something similar by searching for messages that aren't tagged either spam or ham, looking in each for the header and adding the appropriate tag. It's clunky and maybe even brittle, but it works well enough until notmuch gains the ability to search for arbitrary headers. -James