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 F36E26DE1EEF for ; Mon, 6 Mar 2017 16:23:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -1.364 X-Spam-Level: X-Spam-Status: No, score=-1.364 tagged_above=-999 required=5 tests=[AWL=-0.027, 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 mGnEMuEcuUSY for ; Mon, 6 Mar 2017 16:23:19 -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 5C3986DE1EE1 for ; Mon, 6 Mar 2017 16:23:19 -0800 (PST) Received: from smtp02.caltech.edu (localhost [127.0.0.1]) by smtp02.caltech.edu (Postfix) with ESMTP id 1FE066C2099; Mon, 6 Mar 2017 16:23:19 -0800 (PST) X-Spam-Scanned: at Caltech-IMSS on smtp02.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 B93A56C1DF1; Mon, 6 Mar 2017 16:23:18 -0800 (PST) Received: by finestructure.net (Postfix, from userid 1000) id B035B6023E; Mon, 6 Mar 2017 16:23:18 -0800 (PST) From: Jameson Graef Rollins To: Steven Allen Cc: notmuch@notmuchmail.org Subject: Re: whitelisting In-Reply-To: <87fuiq0x91.fsf@bistromath> References: <87innmvvam.fsf@ligo.caltech.edu> <87fuiq0x91.fsf@bistromath> User-Agent: Notmuch/0.23.5 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-pc-linux-gnu) Date: Mon, 06 Mar 2017 16:23:18 -0800 Message-ID: <878toivssp.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:23:20 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, Mar 06 2017, Steven Allen wrote: > Instead of iterating over all messages in spam, why not just iterate > over *new* messages (`tag:new`) in your pre hook? That is (pseudo code): > > for message in `notmuch search tag:new and tag:spam`: > for author in message.headers["From"]:=20 > author =3D clean(author) # Extract the *actual* email address= (name@domain). > # There are probably faster ways to check this... > if `notmuch count tag:sent and to:author` > 0: > notmuch tag -spam -- message > > That should be reasonably fast. Thanks for the suggestion, Steven. Yes, my intention was to restrict over just "new", and yes, it is considerably faster. Thanks for the tip. jamie. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEtl0IW5QRe4ExYLZZ7TTOq+J7qrwFAli9/XYACgkQ7TTOq+J7 qrzcRQ//UZ3oEX4sOZkwpQPL9YKzSYfoZBYKQJKZ4NqwnYWkXH5sutyn/YOP7h2Q Atfe2CnEj5J0/J11s5TJLvEFlx+pe5FSrhlOuhT+hRuM3MzZoOVy4f6QWFKgkfLh NEk1avhV+KJOaxwKGl0AqBQWFAHP/RHrpR8kgQiIgWRs2HMBeAdgZc8EJqVv3U3R Bfao6jYXmxy2+twwRnTNPwCfrG92n5v5UB8W4Js3LP+suYQjZrv5IU5uneacLbha vgsNuUgK4JxMxnj7pN+Gz+8uRWVJHcrY6qCUe7FxT1hby52xnri5ltE/arRMWEFm VHz0XKFurF2z0x9Qo5KAoqxwCxV0PxZi8O8OjWpQDMmjeEW4zJw9wFCrjpZ/neGG UKIDKCupYOgECqVwVveGOpW2/f6EN4l02rOGVIixOTKPcomTutIZ/ZWBfUjMZ4Lk MEJrjREciurTg5irhDtv2JfGXk9rl3UNUq0fkjubcxNJAraYmT6iHzpvtBuQVyp3 BgAVbMzkjKJEXgqA+ugDwO49mtWRvkUW2PKl52jWiwgHTkrvkfkNuzEaL50ATrEK cpVd03W+aa+f+0y2ow4xOlYVGC+efYYJuAX4HsBGANuTHdWbJnJ/HAZJp6tsNSpF zTj7G1pTlQTVHE8mhu/+mW8vUb2EPt2SmbVPeJCnWggffYml6sY= =46lk -----END PGP SIGNATURE----- --=-=-=--