From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id BE1546DE1D02 for ; Mon, 6 Mar 2017 16:06:45 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -1.268 X-Spam-Level: X-Spam-Status: No, score=-1.268 tagged_above=-999 required=5 tests=[AWL=0.069, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_SOFTFAIL=0.972, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iH9POZczo_uG for ; Mon, 6 Mar 2017 16:06:42 -0800 (PST) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by arlo.cworth.org (Postfix) with ESMTPS id E028A6DE1D00 for ; Mon, 6 Mar 2017 16:06:41 -0800 (PST) Received: from smtp01.caltech.edu (localhost [127.0.0.1]) by smtp01.caltech.edu (Postfix) with ESMTP id C3791A2B81 for ; Mon, 6 Mar 2017 16:06:40 -0800 (PST) X-Spam-Scanned: at Caltech-IMSS on smtp01.caltech.edu by amavisd-new Received: from finestructure.net (gwave-71.ligo.caltech.edu [131.215.114.71]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jrollins) by smtp-server.its.caltech.edu (Postfix) with ESMTPSA id 631F5A1CBD for ; Mon, 6 Mar 2017 16:06:40 -0800 (PST) Received: by finestructure.net (Postfix, from userid 1000) id 4ECE96023E; Mon, 6 Mar 2017 16:06:40 -0800 (PST) From: Jameson Graef Rollins To: notmuch@notmuchmail.org Subject: Re: whitelisting In-Reply-To: <87innmvvam.fsf@ligo.caltech.edu> References: <87innmvvam.fsf@ligo.caltech.edu> User-Agent: Notmuch/0.23.5 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-pc-linux-gnu) Date: Mon, 06 Mar 2017 16:06:38 -0800 Message-ID: <87efyavtkh.fsf@ligo.caltech.edu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Tue, 07 Mar 2017 00:06:45 -0000 --=-=-= Content-Type: text/plain On Mon, Mar 06 2017, Jameson Graef Rollins wrote: > I could try to write a python script to iterate over all tag:spam, > extract addresses from those messages, and match against the > whitelist, but I doubt that will be any faster. So a custom python script that iterates over all tag:new messages and matches addresses against the white list is actually quite fast, so hopefully this will be sufficient for my needs: query = 'tag:new AND tag:spam' me = get_me_addrs() whitelist = list(whitelist_iter()) with notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) as db: query = db.create_query(query) for doc in query.search_messages(): a = match_addr(doc.get_header('From')) if a in whitelist: db.begin_atomic() doc.remove_tag('spam') db.end_atomic() Guess I should have checked that first, so sorry about the noise. Still curious if anyone has come up with any other creative solutions to this issue though... jamie. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEtl0IW5QRe4ExYLZZ7TTOq+J7qrwFAli9+Y4ACgkQ7TTOq+J7 qry8QQ//ajXiqIQnkIz6GX4Omi/aXf1R0jPENhjS2YCL5w9G40hD8f+fg7XUrsUr VimlszZN0LKn9jLaVqE57rLO0MgnlTGvqyh6gTXm39Mr+xqm57eCZLukZhPM3a7u nDygFGzfwowG3fasszXECnzTBqCKoGSIGNnUPZQv+386YGDXM8gADd0JtkvsO0iY C/LlE+Esl5vOSovtWJN2E0/UNQeVveFKP5LGsrGg2IZdjDlOjNwfmxnNWTwuZSDU IjRhL85Bbnwb26IwEldMIhvDoqo1FJ1GWTzswjVcSJRcLludpt+72koBb6wtUEFj 5I0/e56Rl8gyaKRYckIshdnwtofLwFsrfFUhaYizQ8CiGP+/qU0ntjkUx+BKtfp7 yJvn2GfUy/xAVA+JStkmdodGsnOMV24g0aXCSShP7+KcR2a/WwzMjvK99r0QajL4 DqSUsuTPBy9Ml8NBH885Ig0auWVlfj6qkgkNRZpbJ/gy/E55NMw8etP9R+5QBCt6 djZV9XpXDAA7YVbBii6q7nbdrVxdLaWyjXSnyxueEb1ESEc0aStrBFkhwL1qxu36 mfNPOoSXBNUK90Kk7gkzw/VMV2ftbHF0Q5ADK1XY1zmuUGjWDzYlsKqO7dZ2JrcU lEhnJIPejHrMxBpNE+pBX72gjgxTVyzwur/1a+6I39Nifo3oJXk= =Dzxl -----END PGP SIGNATURE----- --=-=-=--