[notmuch] automatically assigning tags to new messages?

2009-12-18 Thread Alex Ghitza

Dear notmuch crowd,

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.

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
- 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 
- if it is coming from me, tag it +sent, but not +unread or +inbox

There's probably more, but this is a good start.  Any advice?

[My current email setup is as follows: get messages from the Gmail
account using fetchmail; run procmail with a bunch of recipes that put
the messages into various maildirs; read the results with mutt.  (Oh,
and send mail with msmtp from mutt.)]


Best,
Alex


-- 
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/


[notmuch] automatically assigning tags to new messages?

2009-12-18 Thread Marten Veldthuis
On Fri, 18 Dec 2009 22:21:54 +1100, Alex Ghitza  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.organd 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


Re: [notmuch] automatically assigning tags to new messages?

2009-12-18 Thread Carl Worth
On Fri, 18 Dec 2009 12:54:39 +0100, Marten Veldthuis  
wrote:
> > - 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).

Hi Marten,

I'm not sure what's different about this case. A command like those you
provided earlier should work fine.

The "notmuch tag" command only tags individual messages explicitly
matched by the search terms. It never expands the tagging to unmatched
messages in the same thread.

-Carl

PS. I've talked before about allowing for the configuration file to do
automatic tagging of messages. I've also talked about making something
like "virtual tags" where any automatically-applied tags would act
somehow differently than standard flags.

More recently, my thinking is taking me away from both of those ideas. I
think now that what I want in the configuration file is simply a set of
saved search strings. Something like:

[search]
interesting = to:notmuchmail.org and not from:cworth

and then this could be used within a search string such as:

notmuch show search:interesting

This would make it very clear that "saved searches" are separate from
tags, and you might very well want to combine them in a single search:

notmuch show search:interesting or tag:interesting

As I think about this, I think these saved searches could displace much
of my use of tags, (at least all of the tags which I'm automatically
applying in the script I run after "notmuch new"). The big difference
would be that the UI wouldn't provide an indication of a message
matching particular saved searches the way it does for tags. But I might
actually prefer that, (since currently, I have so many
automatically-applied tags on every message that the display is often
just a lot of noise).

Anyway, that's something I plan to experiment with.


pgpmCcEFDuItb.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] automatically assigning tags to new messages?

2009-12-18 Thread Carl Worth
On Fri, 18 Dec 2009 12:54:39 +0100, Marten Veldthuis  
wrote:
> > - 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).

Hi Marten,

I'm not sure what's different about this case. A command like those you
provided earlier should work fine.

The "notmuch tag" command only tags individual messages explicitly
matched by the search terms. It never expands the tagging to unmatched
messages in the same thread.

-Carl

PS. I've talked before about allowing for the configuration file to do
automatic tagging of messages. I've also talked about making something
like "virtual tags" where any automatically-applied tags would act
somehow differently than standard flags.

More recently, my thinking is taking me away from both of those ideas. I
think now that what I want in the configuration file is simply a set of
saved search strings. Something like:

[search]
interesting = to:notmuchmail.org and not from:cworth

and then this could be used within a search string such as:

notmuch show search:interesting

This would make it very clear that "saved searches" are separate from
tags, and you might very well want to combine them in a single search:

notmuch show search:interesting or tag:interesting

As I think about this, I think these saved searches could displace much
of my use of tags, (at least all of the tags which I'm automatically
applying in the script I run after "notmuch new"). The big difference
would be that the UI wouldn't provide an indication of a message
matching particular saved searches the way it does for tags. But I might
actually prefer that, (since currently, I have so many
automatically-applied tags on every message that the display is often
just a lot of noise).

Anyway, that's something I plan to experiment with.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



Re: [notmuch] automatically assigning tags to new messages?

2009-12-18 Thread Marten Veldthuis
On Fri, 18 Dec 2009 22:21:54 +1100, Alex Ghitza  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@notmuchmail.organd 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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] automatically assigning tags to new messages?

2009-12-18 Thread Alex Ghitza

Dear notmuch crowd,

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.

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
- 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 
- if it is coming from me, tag it +sent, but not +unread or +inbox

There's probably more, but this is a good start.  Any advice?

[My current email setup is as follows: get messages from the Gmail
account using fetchmail; run procmail with a bunch of recipes that put
the messages into various maildirs; read the results with mutt.  (Oh,
and send mail with msmtp from mutt.)]


Best,
Alex


-- 
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch