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 25D39431FB6 for ; Tue, 15 May 2012 06:49:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 GoVfa+jf8U8O for ; Tue, 15 May 2012 06:49:08 -0700 (PDT) X-Greylist: delayed 345 seconds by postgrey-1.32 at olra; Tue, 15 May 2012 06:49:07 PDT Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id DB62D431FAE for ; Tue, 15 May 2012 06:49:07 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id AB0BD10063A; Tue, 15 May 2012 16:43:31 +0300 (EEST) From: Tomi Ollila To: Austin Clements , Robert Horn Subject: Re: Using procmail to set tags In-Reply-To: <20120515132238.GO11804@mit.edu> References: <20120515132238.GO11804@mit.edu> User-Agent: Notmuch/0.13~rc1+22~g672e3f0 (http://notmuchmail.org) Emacs/23.1.1 (x86_64-redhat-linux-gnu) X-Face: HhBM'cA~ 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: Tue, 15 May 2012 13:49:09 -0000 On Tue, May 15 2012, Austin Clements wrote: > > Alternatively, you can have procmail record the message ID and desired > tags of the message in a file and then apply those recorded tags in > your post-new hook. This would achieve the tagging you want more > directly, without mixing in folders and multiple delivery. The > difficulty would be getting a message ID you could later use in an id: > query. Simply grabbing the value of the message-id header would work > most of the time, but there's a fair bit of logic for dealing with > strangely formed or completely malformed message-id headers > (see _parse_message_id). If procmail is delivering one mail at a time (without parallerism) and notmuch new is executed after each email delivered one could try * put desired tags into environment (export NEW_TAGS='+foo +bar') * execute notmuch new * use the environment variables in post-new hook (notmuch tags $NEW_TAGS -new tag:new) The risk with this approach (when not recording message-id) is that there ie not just one new mail (with 'new' tag) delivered... Then I sidedtacked to... wouldn't something like notmuch new + - [path/to/filename] be so cool... ;) (yes, so non-trivial...) > > As far as I know, nobody has tried my second suggestion. Most people > just switch to using notmuch queries (either to tag or simply to > search). Tomi