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 982B540BFD3 for ; Tue, 21 Sep 2010 02:44:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.99 X-Spam-Level: X-Spam-Status: No, score=-1.99 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, T_MIME_NO_TEXT=0.01] autolearn=ham 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 0pTtbC4E1vWf for ; Tue, 21 Sep 2010 02:44:40 -0700 (PDT) Received: from homiemail-a18.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145]) by olra.theworths.org (Postfix) with ESMTP id 12E1F40BD85 for ; Tue, 21 Sep 2010 02:44:40 -0700 (PDT) Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 21BBA25006B; Tue, 21 Sep 2010 02:44:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=SSpaeth.de; h=from:to:cc:subject :in-reply-to:references:date:message-id:mime-version: content-type; q=dns; s=sspaeth.de; b=lw0Dfpzu4yrQBlHN2c2N2oRqBn1 Lhsb1DHfVaJHG2mONwLrWd0daCnnGpJmXvl6sFvMkk8Z3UxrfJRtScXppWCIJCYJ r253dgeAwExmQEqFiKZa+XGCEIExO5uHr8r69o//+qYmgMaZ3eDjSESjK8Frwhc5 w1sHW/e2LyV81SuQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=SSpaeth.de; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version: content-type; s=sspaeth.de; bh=lAz3m5K9DnWrRSC2Gum0HHiQeJI=; b=A adsJzq5QD7T6heYOhtzfS6GlfLsVy+B6TdgmmO+sJBsybKtuMBUhE8Q+EOyel1s3 GOwehWtd19acujpJ6jh78UqAOatwWQkxSjiD0ydpZ4pgccMjy6su1+cCr0N/EsUV 39YyNuh45dtatJ9mlEOBXSR/Wel7GEtQqd86MfsaF0= Received: from spaetzbook.sspaeth.de (mtec-hg-docking-2-dhcp-016.ethz.ch [82.130.121.16]) (Authenticated sender: fax@sspaeth.de) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPA id 8B2AC250069; Tue, 21 Sep 2010 02:44:37 -0700 (PDT) Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation); Tue, 21 Sep 2010 11:44:35 +0200 From: Sebastian Spaeth To: Rob Browning Subject: Re: notmuchsync: handling of the deleted tag In-Reply-To: <87r5gnomt2.fsf@raven.defaultvalue.org> References: <87bp7vewa5.fsf@raven.defaultvalue.org> <87mxrcsb8a.fsf@SSpaeth.de> <87r5gnomt2.fsf@raven.defaultvalue.org> User-Agent: Notmuch/0.3.1-43-g5d515b7 (http://notmuchmail.org) Emacs/23.1.50.1 (x86_64-pc-linux-gnu) Date: Tue, 21 Sep 2010 11:44:29 +0200 Message-ID: <87zkvb4eiq.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Notmuch developer list 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, 21 Sep 2010 09:44:50 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On 2010-09-21, Rob Browning wrote: > Conceptually what I'd like for it to do, is reference count -- only mark > the message deleted if every occurrence (across all maildirs) is marked > trashed (T). Right, but that is trickier than might appear at first sight. I parse those file names which notmuch is giving me (by default for mails from the last 30 days, as reparsing ALL your mails every time would be horribly expensive and often unneeded).=20 notmuch is only able to give me one file name (+path) per mail id, so that is what I examine. If that is the one copy that has the mail dir flag "expired/trashed", I tag the message as "deleted".=20 There is little else that notmuchsync can do here. I ask for new messages and their file path and if they are expired mark it as such. I have no way of finding out if there are other mails with the same mail id from notmuch (unless I am very much mistaken).=20 Doing reference counting would require me/notmuchsync to parse ALL your mails by itself and finding out the often horribly mail id from the mail headers myself... something that notmuchsync does not want to get into. See the problem? I could do reference counting if notmuch were able to tell me how many file names/paths are associated with a mail id. > Though even there I can imagine corner cases: imagine that notmuch > doesn't initially see all your maildirs -- perhaps because you're using > a folder filter in offlineimap, and so there are untrashed copies in the > maildirs it hasn't seen yet. Right that would be a problem. But I cannot do reference counting unless notmuch can give me the number of copies it knows about for a given mail id (and internally it does know all associated file paths, so it would be a simple API extension a la, "get_all_message_file_paths" or similar, or a get_number_of_mail_files(mailid) to start with. > > And what should --revsync do when it finds a mail file that is marked > > as expired. What should notmuch do BTW if there are 2 copies and 1 is expired and 1 not? Mark as "deleted" or not? > Looks like you got cut off there. Right, it was 5pm and I left the computer :). I had intented to rant about the deficiencies of the notmuch 1 document per mail id approach here, but I don't see a better approach. All that would be useful from the notmuch side is to get all associated filenames with a mail id. sebastian --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkyYfn0ACgkQVYX1jMgnoGLvfwCfT2/qB7F4+9rnD3Wa5D4TVVax URwAnRpT9z47Jndv0anDB334SelhYiAq =3Afd -----END PGP SIGNATURE----- --=-=-=--