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 DF8064196F2 for ; Mon, 12 Apr 2010 05:39:03 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 Ke2smViF2sLV for ; Mon, 12 Apr 2010 05:39:02 -0700 (PDT) Received: from clegg.madduck.net (clegg.madduck.net [193.242.105.96]) by olra.theworths.org (Postfix) with ESMTP id 47396431FC1 for ; Mon, 12 Apr 2010 05:39:02 -0700 (PDT) Received: from piper.oerlikon.madduck.net (piper.oerlikon.madduck.net [IPv6:2a01:198:4e2:0:211:2fff:fe6b:c869]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "piper.oerlikon.madduck.net", Issuer "CAcert Class 3 Root" (verified OK)) by clegg.madduck.net (postfix) with ESMTPS id 7C2A61D4099; Mon, 12 Apr 2010 14:38:54 +0200 (CEST) Received: by piper.oerlikon.madduck.net (Postfix, from userid 1000) id 48309CC; Mon, 12 Apr 2010 14:38:53 +0200 (CEST) Date: Mon, 12 Apr 2010 14:38:53 +0200 From: martin f krafft To: Michal Sojka Subject: Re: [PATCH] Mailstore abstraction v4 - part 2 (maildir synchronization) Message-ID: <20100412123853.GA26402@piper.oerlikon.madduck.net> Mail-Followup-To: Michal Sojka , notmuch@notmuchmail.org References: <1270739592-30280-1-git-send-email-sojkam1@fel.cvut.cz> <20100412081805.GA25971@lapse.rw.madduck.net> <87hbngc2og.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-ripemd160; protocol="application/pgp-signature"; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline In-Reply-To: <87hbngc2og.fsf@steelpick.2x.cz> X-Motto: Keep the good times rollin' X-OS: Debian GNU/Linux squeeze/sid kernel 2.6.33-2-amd64 x86_64 X-Spamtrap: madduck.bogus@madduck.net X-Subliminal-Message: debian/rules! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.3 at clegg X-Virus-Status: Clean 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: Mon, 12 Apr 2010 12:39:04 -0000 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable also sprach Michal Sojka [2010.04.12.1347 +0200]: > > Wouldn't it be better to postpone synchronisation of the tags > > until after emacs is done with the message? >=20 > Theoretically, it would be possible, but if, for some reason, the > synchronization step would not happen, then the tags in the > database and in the mailstore will be inconsistent and next run of > notmuch new would reset the tags according to the state in > mailstore. Well, sure. But then again, notmuch (nor IMAP or Maildir) isn't transactional anyway. There are many other ways in which the database and store can get out of sync. And you are about to add another redundancy. > The current implementation takes tags in mailstore as > authoritative and ensures that tags in mailstore are always > updated before tags in the database. So why store them in the database at all? > > I understand this might be hard to make work with mailstore > > abstraction. Wouldn't it make more sense to have emacs call > > 'notmuch cat', which returns the entire message, removes the > > unread tag, changes the filename, and updates the database? >=20 > I do not like the fact that cat would do two things - cat and tag. > And then, 'unread' tag is not the only one which can be changed. I wouldn't want an unread tag in the first place, especially not with Maildir semantics. In this case, what should really happen is: 1. cat feeds a message to client 2. client instructs notmuch to update tags - some tags require changes in the database - others require filename changes, which must be completed in unison with a database update so the new filename is stored. 3. user asks to see attachment, which the client can fulfill using either a cached copy from (1.) in a tempfile, or by simply asking for the message again, via notmuch search. > > The message returned by cat would be stored in a temporary file > > for use by the client (emacs). And if the message was needed > > again, you could just search for it again. > >=20 > > I dislike the idea of heuristically probing a Maildir for files. >=20 > Well, I do not plan to use wired heuristics. At the end there will > be readdir() to traverse the cur/ directory to find the file with > the same part before flags. Since the S flag will probably be the > most frequent change, I may add one single test for added S flag > before trying more expensive readdir(). What is the point of storing these tags in the Maildir anyway? If you want to make this information (e.g. new, seen, unread) available to MUAs accessing Maildir directly, keep in mind that the database and mailstore will very quickly grow inconsistent until the next notmuch-new run, e.g. as messages are moved, or flags ('F') are added in a way that the notmuch database is not updated. --=20 martin | http://madduck.net/ | http://two.sentenc.es/ =20 "friendships last when each friend thinks he has a slight superiority over the other." -- honor=E9 de balzac =20 spamtraps: madduck.bogus@madduck.net --qMm9M+Fa2AknHoGS Content-Type: application/pgp-signature; name="digital_signature_gpg.asc" Content-Description: Digital signature (see http://martin-krafft.net/gpg/) Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEAREDAAYFAkvDFFwACgkQIgvIgzMMSnU7rQCgzTHgMBgdKX70W/TIFZ42WLU7 3XoAnj88FKdu2GOy/pvWkjCFQlBsFoSr =JZUV -----END PGP SIGNATURE----- --qMm9M+Fa2AknHoGS--