Re: whitelisting

Subject: Re: whitelisting

Date: Mon, 06 Mar 2017 16:23:18 -0800

To: Steven Allen

Cc: notmuch@notmuchmail.org

From: Jameson Graef Rollins


On Mon, Mar 06 2017, Steven Allen <steven@stebalien.com> 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"]: 
>             author = 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.
signature.asc (application/pgp-signature)

Thread: