Re: [PATCH 0/4] Maildir synchronization
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 30 Oct 2010 12:13:50 +0000 (14:13 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:20 +0000 (09:37 -0800)
76/6054d09dfb326a85e7b0ba485a4084daf31b54 [new file with mode: 0644]

diff --git a/76/6054d09dfb326a85e7b0ba485a4084daf31b54 b/76/6054d09dfb326a85e7b0ba485a4084daf31b54
new file mode 100644 (file)
index 0000000..fa47e58
--- /dev/null
@@ -0,0 +1,133 @@
+Return-Path: <sojkam1@fel.cvut.cz>\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 4469E40D16C\r
+       for <notmuch@notmuchmail.org>; Sat, 30 Oct 2010 06:01:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9] autolearn=unavailable\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 q-Lt2Tti4cwq for <notmuch@notmuchmail.org>;\r
+       Sat, 30 Oct 2010 06:01:38 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5941A40D167\r
+       for <notmuch@notmuchmail.org>; Sat, 30 Oct 2010 06:01:26 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 5BC7019F32FD;\r
+       Sat, 30 Oct 2010 15:01:25 +0200 (CEST)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id ntlXbL76wkij; Sat, 30 Oct 2010 15:01:23 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id D4C3919F32FF;\r
+       Sat, 30 Oct 2010 15:01:23 +0200 (CEST)\r
+Received: from wsheee.2x.cz (charon.finaltek.com [217.11.241.201])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id C0FE9FA005;\r
+       Sat, 30 Oct 2010 15:01:23 +0200 (CEST)\r
+Received: from wsh by wsheee.2x.cz with local (Exim 4.72)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1PCAJi-0004V4-6k; Sat, 30 Oct 2010 14:13:50 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Carl Worth <cworth@cworth.org>, Dirk Hohndel <hohndel@infradead.org>,\r
+       Matt Fleming <matt@console-pimps.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 0/4] Maildir synchronization\r
+In-Reply-To: <87sjzopmga.fsf@yoom.home.cworth.org>\r
+References: <1273580061-22580-1-git-send-email-sojkam1@fel.cvut.cz>\r
+       <87d3w082dh.fsf@linux-g6p1.site> <m3zkz3d210.fsf@x201s.gr8dns.org>\r
+       <87typbzdnt.fsf@steelpick.2x.cz>\r
+       <87sjzopmga.fsf@yoom.home.cworth.org>\r
+User-Agent: Notmuch/0.3.1-113-g782e2e3 (http://notmuchmail.org) Emacs/23.2.1\r
+       (i486-pc-linux-gnu)\r
+Date: Sat, 30 Oct 2010 14:13:50 +0200\r
+Message-ID: <87tyk3vpxd.fsf@wsheee.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\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: Sat, 30 Oct 2010 13:01:49 -0000\r
+\r
+On Sat, 30 Oct 2010, Carl Worth wrote:\r
+> On Thu, 10 Jun 2010 06:59:02 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+> > This is a known limitation.\r
+> > From id:1273580061-22580-3-git-send-email-sojkam1@fel.cvut.cz:\r
+> > \r
+> >    The reason is that when you view the message its unread tag is\r
+> >    removed which leads to rename of the file, but Emacs still uses the\r
+> >    original name to access the attachment.\r
+> > \r
+> >    Workaround: close the message and open it again.\r
+> \r
+> These patches do indeed look very interesting. But the above limitation\r
+> is really too severe. It just breaks things to much. Let's get that\r
+> fixed first.\r
+> \r
+> > IMHO, the final solution to this issue would be the "notmuch cat"\r
+> > command. With this command, emacs would not access the messages by file\r
+> > name, but by message id.\r
+> \r
+> Sounds like a great idea. Instead of "notmuch cat", how about we name\r
+> this "notmuch show --format=raw"? That should be even easier to\r
+> implement, too.\r
+\r
+See id:1287739684-26188-1-git-send-email-sojkam1@fel.cvut.cz for my last\r
+attempt to implement this. I didn't implement it as --format=raw because\r
+it seems that notmuch show always constructs threads even if they are\r
+not used. I didn't check the code carefully so I may be wrong. Let me\r
+know if you really prefer raw format over cat.\r
+\r
+> Finally, as for configuration, I don't like the numeric codes for this\r
+> feature. Do we really need that much granularity in the functionality\r
+> here? Other mail clients certainly don't. From what I can see, most mail\r
+> clients just twiddle these flags unconditionally.\r
+> \r
+> I can imagine some people might want to be able to turn the feature off\r
+> entirely, so maybe we'll need that.>\r
+\r
+I agree that having only on/off settings should be sufficient for most\r
+users. I'll send updated patches in a while.\r
\r
+> Or perhaps more importantly than configuration, we need the ability to\r
+> easily migrate people to a synchronized state. For example, in my\r
+> current mail store, most filenames have never been changed, so I've got\r
+> a lot of files with flags that don't match my tags. What do you think\r
+> would be the best way to resolve a situation like that?\r
+\r
+One thing is that if you simply enable maildir synchronization and run\r
+notmuch new, it should not touch your tags as the tags are modified only\r
+when a new or renamed message is found. So if one doesn't modify the\r
+flags by other programs it is safe to enable maildir synchronization.\r
+\r
+Then, if other programs that may modify the flags are used, the mail\r
+store flags should be made synchronized. One way of doing this manually\r
+is to execute the following sequence of commands after enabling maildir\r
+synchronization.\r
+\r
+notmuch dump > x    # stores the tags\r
+notmuch new         # makes sure that the file names in the database are up to date\r
+notmuch restore < x # sets maildir flags to match the tags\r
+\r
+If you want this to happen automatically, it might be possible to\r
+modify notmuch new to use something like\r
+notmuch->xapian_db->get_metadata("maildir_in_sync") and if this metadata\r
+is not found and the maildir synchronization is enabled then it would\r
+synchronize the flags and set the database metadata.\r
+\r
+-Michal\r