From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3B436429E26 for ; Mon, 25 Apr 2011 19:38:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 Vt1YLbg3KKhU for ; Mon, 25 Apr 2011 19:38:51 -0700 (PDT) Received: from mail-pw0-f53.google.com (mail-pw0-f53.google.com [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7FB4E431FD0 for ; Mon, 25 Apr 2011 19:38:51 -0700 (PDT) Received: by pwj7 with SMTP id 7so194462pwj.26 for ; Mon, 25 Apr 2011 19:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oanNgTiZSCPHEyit0epp+qHoCa9WxxQhQvFsSxQqUpo=; b=Mq4xeoj3AwteM+THzOyx3IMCeOe5Mx0VdOa7R5Nr4XhuR1YiJoumdjGXtR+sbNKcBC XT5IXbWComnxnyrFb0n6sh9spc+FwSPIbXQ4wb0WggiRcbkp3r1rR0d6ykpNV7sMnosH WGUcVakY12pXnWOHhL+IhJ8Hem9w7Pr4GL4Kw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=BOon7MicgO7rsdrvmV2w4TrKdGsPmVHZqsxOQxw6NVTllp1AzSdQD9BNtD61vrxaNq SuRVu8kJVadiGeIy+2UmbtkdsTJvtIHJ6kyWiuTNbEqWqsxo9TOzNBTQ+wiuhJeVDuFS vCgixASpi0UympCKXTbtyBGB+E38vlxTdo4VU= MIME-Version: 1.0 Received: by 10.68.65.78 with SMTP id v14mr322013pbs.204.1303785529105; Mon, 25 Apr 2011 19:38:49 -0700 (PDT) Received: by 10.68.58.225 with HTTP; Mon, 25 Apr 2011 19:38:48 -0700 (PDT) In-Reply-To: References: <8739ll8dkv.fsf@eve.chaoflow.net> <87pqomgxr0.fsf@A7GMS.i-did-not-set--mail-host-address--so-tickle-me> <878vv8hh3u.fsf@servo.factory.finestructure.net> Date: Mon, 25 Apr 2011 22:38:48 -0400 Message-ID: Subject: Re: (auto-)tagging sent messages From: servilio To: Austin Clements Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 26 Apr 2011 02:38:52 -0000 On 18 April 2011 16:26, Austin Clements wrote: > On Sun, Apr 17, 2011 at 2:23 PM, Jameson Graef Rollins > wrote: >> By giving "notmuch new" a path to a message in the store: >> >> =C2=A0notmuch new /path/to/message >> >> By feeding "notmuch new" a message on stdin, and then having it write >> the message to a specified location: >> >> =C2=A0notmuch new /path/to/maildir > >> You could then add the ability to add tags at the time of index: >> >> =C2=A0notmuch new +foo +bar /path/to/message I like more the idea of using a CLI option, e.g.: notmuch new --tag=3Dfoo --tag=3Dbar /path/to/message > I think passing specific messages or directories to notmuch new would > enable some nice features; beyond immediate indexing any tagging of > sent mail, it could be combined with inotify to immediately index any > new mail I would add "efficiently", it can be done right now, but it would scan the whole mail sub-tree everytime. > However, concurrency and atomicity have to be considered carefully > with any proposal like this. =C2=A0For example, > =C2=A0notmuch new +foo +bar /path/to/message > has concurrency hazards: the caller has to store the message before > invoking notmuch new, but if the machine crashes between these two > operations, the message will be indexed with default tags on the next > notmuch new. =C2=A0Similarly, a chance unrelated invocation of notmuch ne= w > immediately after the message is stored would result in the new > message being indexed with default tags. One solution to both issues would be to add the feature to "notmuch new" of taking the initial tags from a custom header (e.g.: X-Notmuchmail-Agent-Initial-Tags), and use message-ignored-mail-headers[1] to filter this header out the sent message. Servilio [1] http://www.gnu.org/software/emacs/manual/html_mono/message.html#Mail-He= aders