Using procmail to set tags

Robert Horn rjhorn at alum.mit.edu
Fri May 18 07:48:08 PDT 2012


Tomi Ollila <tomi.ollila at iki.fi> writes:

> On Tue, May 15 2012, Austin Clements <amdragon at MIT.EDU> wrote:
>   * execute notmuch new
>   * use the environment variables in post-new hook 
>       (notmuch tags $NEW_TAGS -new tag:new)
>
Thanks to all, that gave me enough hints to make progress.

It looks like adding a new tag in the config, "needsProcessing", and
then a post-new hook to a script that I write should do the job.
Instead of dealing an even more complex and arcane procmail setup, I
write a script that runs as the post-new hook.  I'm finding the "new"
flagging works correctly for simple mail drop from postfix, so the extra
flag will work.  I don't want to work off "new" because that's also
useful for mail reading and other uses.  The post-new hook can start by
finding the emails that are tagged "needsProcessing", parse and tag them
appropriately, and remove the needsProcessing tag.  It just needs to
start with a query and be written to work on all the messages found, so it
doesn't matter how many are new.

At the moment it looks like a simple python script using the notmuch
library binding may be easiest. If not, there are other tools to do the
job.

R Horn
rjhorn at alum.mit.edu


More information about the notmuch mailing list