[notmuch] automatically assigning tags to new messages?

Marten Veldthuis marten at veldthuis.com
Fri Dec 18 03:54:39 PST 2009


On Fri, 18 Dec 2009 22:21:54 +1100, Alex Ghitza <aghitza at gmail.com> wrote:
> I heard about notmuch mail a few days ago and I started playing with
> it.  So far, it makes me very happy, but there are some things that I
> need to learn how to do.  I'll start with the most important one:
> tagging incoming messages automatically.

I've got a script somewhere which I invoke after each mail sync. I'll
give some examples from that for your list below.

> What is the recommended way of achieving this?  There is a variety of
> things that I would like to automatically do to incoming mail:
> - if it comes from a mailing list (e.g. notmuch), tag it +notmuch and
>   +unread, but not +inbox

notmuch tag +list +notmuch -inbox      to:notmuch at notmuchmail.org    and not tag:notmuch and tag:inbox

> - if it's one of the numerous pointless weekly newsletters that I'm
>   getting from my university, tag it +unimelb, but not +unread or
>   +inbox 

notmuch tag +unimelb -unread -inbox   to:foo and not tag:unimelb and tag:unread and tag:inbox

> - if it is coming from me, tag it +sent, but not +unread or +inbox

Not quite sure. Currently I'm not doing this, don't know if this is
possible within a single incantation of notmuch-tag. I think you
probably need a first search to get message ids, and then tag only those
message ids (doing it like the others above would tag all messages in
the thread with sent, which is probably not what you want).

-- 
- Marten


More information about the notmuch mailing list