Re: [notmuch] Potential problem using Git for mail (was: Idea for storing tags)
[notmuch-archives.git] / e6 / 9f0f6fc6b703f3959d59a2deb6a4902700d4a9
diff --git a/e6/9f0f6fc6b703f3959d59a2deb6a4902700d4a9 b/e6/9f0f6fc6b703f3959d59a2deb6a4902700d4a9
new file mode 100644 (file)
index 0000000..1e80607
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <asheesh@asheesh.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 53114431FBC\r
+       for <notmuch@notmuchmail.org>; Wed, 20 Jan 2010 22:29:03 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.866\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.866 tagged_above=-999 required=5\r
+       tests=[AWL=-0.867, BAYES_50=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id vDExmRA8Fhyi for <notmuch@notmuchmail.org>;\r
+       Wed, 20 Jan 2010 22:29:02 -0800 (PST)\r
+Received: from mout.perfora.net (mout.perfora.net [74.208.4.194])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4A91D431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 20 Jan 2010 22:29:02 -0800 (PST)\r
+Received: from rose.makesad.us ([219.105.37.19])\r
+       by mx.perfora.net (node=mxus0) with ESMTP (Nemesis)\r
+       id 0MFMxY-1Nb5ei3vMK-00F0PX for notmuch@notmuchmail.org;\r
+       Thu, 21 Jan 2010 01:29:01 -0500\r
+Received: from renaissance (localhost [127.0.0.1])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by rose.makesad.us (Postfix) with ESMTPS id E79EAA0008;\r
+       Thu, 21 Jan 2010 01:28:55 -0500 (EST)\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by renaissance (Postfix) with ESMTPS id A9EF1CDC15;\r
+       Thu, 21 Jan 2010 01:28:50 -0500 (EST)\r
+Date: Thu, 21 Jan 2010 01:28:50 -0500 (EST)\r
+From: Asheesh Laroia <asheesh@asheesh.org>\r
+X-X-Sender: paulproteus@localhost\r
+To: martin f krafft <madduck@madduck.net>\r
+In-Reply-To: <20100114203730.GE4691@lapse.rw.madduck.net>\r
+Message-ID: <alpine.DEB.2.00.1001210124590.24778@localhost>\r
+References: <20100111221909.GA30299@lapse.rw.madduck.net>\r
+       <1263267603-sup-302@elise>\r
+       <20100112045152.GA15275@lapse.rw.madduck.net>\r
+       <alpine.DEB.2.00.1001140254240.27198@vellum>\r
+       <20100114203730.GE4691@lapse.rw.madduck.net>\r
+User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)\r
+X-OpenPGP-Key-ID: 0x70096AD1\r
+MIME-Version: 1.0\r
+Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-77550140-1264055330=:24778"\r
+Cc: notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: [notmuch] Potential problem using Git for mail (was: Idea for\r
+ storing tags)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 21 Jan 2010 06:29:03 -0000\r
+\r
+  This message is in MIME format.  The first part should be readable text,\r
+  while the remaining parts are likely unreadable without MIME-aware tools.\r
+\r
+--8323328-77550140-1264055330=:24778\r
+Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed\r
+Content-Transfer-Encoding: 8BIT\r
+\r
+On Fri, 15 Jan 2010, martin f krafft wrote:\r
+\r
+> also sprach Asheesh Laroia <asheesh@asheesh.org> [2010.01.14.2112 +1300]:\r
+>> Sure. But the MDA doesn't need to do the commit immediately. Since\r
+>> (presumably) we're using Maildir, the MDA on the mail receiving\r
+>> server is going to generate filenames that won't cause conflicts.\r
+>> So it's okay to leave the files uncommitted.\r
+>\r
+> So when does the commit happen?\r
+>\r
+>> When I did the "git merge", git would create the Maildir files in\r
+>> ~/Maildir/cur/... non-atomically.\r
+>\r
+> This might be something that the Git people could address if it was\r
+> brought up on the mailing list. Then again, it might not be possible\r
+> without going via a temporary file, which I doubt will fly.\r
+\r
+A temporary file + rename() is the only way, as far as I know.\r
+\r
+> I suppose that I never actually considered merges on the IMAP server \r
+> side, but obviously the IMAP server has to work off a clone, and that \r
+> means it needs to merge.\r
+\r
+It's not "merge" that's unsafe; that just builds a tree in the git index \r
+(assuming no conflicts). It's the ensuing process of git writing a tree to \r
+the filesystem that is problematic.\r
+\r
+I could probably actually write a wrapper that locks the Maildir while git \r
+is operating. It would probably be specific to each IMAP server.\r
+\r
+Note that this mean git is fundamentally incompatible with Maildir, not \r
+just IMAP servers.\r
+\r
+>> Dovecot would notice the file in ~/Maildir/cur/ and think, "This file \r
+>> must be ready!" So it would parse it even though git hadn't finished \r
+>> writing it. This caused me to only see partial headers in Alpine since \r
+>> Dovecot parsed it before it was a complete message.\r
+>\r
+> I wonder if a custom merge driver could address this to properly use \r
+> …/tmp/ to assemble the message and only then move it.\r
+\r
+I don't think a merge driver can do it for the reason stated above.\r
+\r
+-- Asheesh.\r
+\r
+-- \r
+I always turn to the sports pages first, which record people's accomplishments.\r
+The front page has nothing but man's failures.\r
+               -- Chief Justice Earl Warren\r
+--8323328-77550140-1264055330=:24778--\r