--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 867D76DE0FF8\r
+ for <notmuch@notmuchmail.org>; Wed, 2 Sep 2015 16:07:04 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.114\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.114 tagged_above=-999 required=5 tests=[AWL=0.114]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id SKIr0lW4b9Z1 for <notmuch@notmuchmail.org>;\r
+ Wed, 2 Sep 2015 16:07:01 -0700 (PDT)\r
+Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 95E916DE0B25\r
+ for <notmuch@notmuchmail.org>; Wed, 2 Sep 2015 16:07:01 -0700 (PDT)\r
+Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1ZXH6K-0004MY-0S; Wed, 02 Sep 2015 23:05:56 +0000\r
+Received: (nullmailer pid 27808 invoked by uid 1000); Wed, 02 Sep 2015\r
+ 23:05:35 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Amadeusz =?utf-8?B?xbtvxYJub3dza2k=?= <aidecoe@aidecoe.name>, David\r
+ Mazieres expires 2015-11-29 PST\r
+ <mazieres-sggp47c7j46624db3rharctcei@temporary-address.scs.stanford.edu>\r
+Subject: Re: muchsync files renames\r
+In-Reply-To: <87r3mgldor.fsf@freja.aidecoe.name>\r
+References: <878u93ujdo.fsf@freja.aidecoe.name>\r
+ <876146o920.fsf@ta.scs.stanford.edu> <871teu8kdd.fsf@freja.aidecoe.name>\r
+ <87oahxojlv.fsf@ta.scs.stanford.edu> <87vbbwnbb4.fsf@freja.aidecoe.name>\r
+ <87io7wr50y.fsf@ta.scs.stanford.edu> <87k2sbmzww.fsf@freja.aidecoe.name>\r
+ <87oahnmkqf.fsf@ta.scs.stanford.edu> <87egijm7kw.fsf@freja.aidecoe.name>\r
+ <878u8rvxap.fsf@ta.scs.stanford.edu> <87613tn45m.fsf@freja.aidecoe.name>\r
+ <87vbbthd1m.fsf@maritornes.cs.unb.ca> <87r3mgldor.fsf@freja.aidecoe.name>\r
+User-Agent: Notmuch/0.20.2+60~gcb08a2e (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 02 Sep 2015 20:05:35 -0300\r
+Message-ID: <87r3mge81s.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Wed, 02 Sep 2015 23:07:04 -0000\r
+\r
+Amadeusz =C5=BBo=C5=82nowski <aidecoe@aidecoe.name> writes:\r
+\r
+> When I have added 'unread' tag the file was still in new/. Only after\r
+> removing 'unread' afterwards the file has been moved to cur/.\r
+\r
+The unread tag corresponds to the *absence* of the ,S flag, so if you\r
+don't add unread at notmuch new, tagging it unread later is effectively\r
+a no-op from the point of view of maildir-flag synching. I guess the\r
+part that is optional is moving from new/foo to cur/foo:2, . I believe\r
+we used to be more aggressive about doing this, but mutt users\r
+complained.\r
+\r
+> So it seems you're right, but take a look at the following excerpt\r
+> from T340-maildir-sync.sh:\r
+>\r
+[...]\r
+> What is different about the test case and my case is that my mail file\r
+> doesn't have ":2," suffix. Adding the suffix to file name makes it\r
+> working as expect by test case. I see I would have to convert my mail\r
+> files names, but I think this inconsistency in notmuch should also take\r
+> some attention.\r
+\r
+Have a look at\r
+\r
+ http://cr.yp.to/proto/maildir.html\r
+ http://www.qmail.org/man/man5/maildir.html\r
+=20=20=20=20=20\r
+I don't think messages in new are supposed to have : in their names. So\r
+this test is dealing with a corner case of some out-of-spec MUA writing\r
+:info onto the filename. So I don't think adding a suffix is the right\r
+thing to do here. It also seems like leaving a message in new/ when\r
+tagging it as unread is a reasonable option.\r
+\r
+The gory details (per David's earlier request) are in\r
+_new_maildir_filename in lib/message.cc.\r
+\r
+\r
+d\r