Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BFED4431FB6 for ; Fri, 18 May 2012 07:48:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5BxoDMQuQSyg for ; Fri, 18 May 2012 07:48:10 -0700 (PDT) Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by olra.theworths.org (Postfix) with ESMTP id 7136D431FAE for ; Fri, 18 May 2012 07:48:10 -0700 (PDT) Received: from quad.robs.office (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id ED0702EDAB; Fri, 18 May 2012 10:48:08 -0400 (EDT) From: Robert Horn To: Tomi Ollila , Austin Clements Subject: Re: Using procmail to set tags In-Reply-To: References: <20120515132238.GO11804@mit.edu> User-Agent: Notmuch/0.13 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-suse-linux-gnu) Date: Fri, 18 May 2012 10:48:08 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Fri, 18 May 2012 14:48:11 -0000 Tomi Ollila writes: > On Tue, May 15 2012, Austin Clements 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@alum.mit.edu