Re: [notmuch] Asynchronous tagging
authorJan Janak <jan@ryngle.com>
Sat, 21 Nov 2009 20:50:10 +0000 (21:50 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:38 +0000 (09:35 -0800)
73/a3bd630c040b1fb13fda435e9cfcc753caabcd [new file with mode: 0644]

diff --git a/73/a3bd630c040b1fb13fda435e9cfcc753caabcd b/73/a3bd630c040b1fb13fda435e9cfcc753caabcd
new file mode 100644 (file)
index 0000000..5724252
--- /dev/null
@@ -0,0 +1,92 @@
+Return-Path: <jan@ryngle.com>\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 E057D431FBC\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 12:50:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 1n1IiYWADvub for <notmuch@notmuchmail.org>;\r
+       Sat, 21 Nov 2009 12:50:12 -0800 (PST)\r
+Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com\r
+       [209.85.218.224])\r
+       by olra.theworths.org (Postfix) with ESMTP id 27567431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 12:50:12 -0800 (PST)\r
+Received: by bwz24 with SMTP id 24so3125220bwz.30\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 12:50:11 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.204.154.207 with SMTP id p15mr2626444bkw.202.1258836611016; \r
+       Sat, 21 Nov 2009 12:50:11 -0800 (PST)\r
+In-Reply-To: <874oon4pgv.fsf@yoom.home.cworth.org>\r
+References: <87fx87u3no.fsf@59A2.org> <874oon4pgv.fsf@yoom.home.cworth.org>\r
+Date: Sat, 21 Nov 2009 21:50:10 +0100\r
+Message-ID: <f35dbb950911211250u5f0e8c05p56da7be3d48bbba8@mail.gmail.com>\r
+From: Jan Janak <jan@ryngle.com>\r
+To: Carl Worth <cworth@cworth.org>\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch@notmuchmail.org\r
+Subject: Re: [notmuch] Asynchronous tagging\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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, 21 Nov 2009 20:50:14 -0000\r
+\r
+On Sat, Nov 21, 2009 at 9:01 PM, Carl Worth <cworth@cworth.org> wrote:\r
+>> 3. I had initially put 'notmuch new' in a cron job (instead of\r
+>> offlineimap postsync hook) and new/search would sometimes complain about\r
+>> missing files in the maildir. =C2=A0The first time this happened, it did=\r
+ not\r
+>> correct itself and I ended up reimporting the database (I had moved some\r
+>> things around so I could have been at fault). =C2=A0Since then I have se=\r
+en\r
+>> these errors on a couple occasions, but they always go away upon\r
+>> rerunning 'notmuch new'. =C2=A0My guess is that it has to do with offlin=\r
+eimap\r
+>> changing flags so I moved 'notmuch new' to the postsync hook and have\r
+>> not seen the errors since. =C2=A0If it is important that notmuch never r=\r
+uns\r
+>> concurrently with an offlineimap sync, it should eventually go in the\r
+>> docs.\r
+>\r
+> Thanks for the pointer.\r
+>\r
+> Does offlineimap use tmp while it's delivering message and then move\r
+> things to new? If so, then maybe all we need to do to fix notmuch to not\r
+> look into tmp directories?\r
+\r
+Yes, it does. I think all delivery agents work this way, IIRC the\r
+reason why messages are first written in tmp and then moved to new is\r
+to make sure that clients do not see partially written messages.\r
+Maildir has been designed to be lock-less so this is needed.\r
+\r
+I get errors about missing files too. There are several reasons why\r
+that can happen:\r
+\r
+ 1) A message is moved from one folder to another in other mail\r
+clients that work with\r
+    the Maildir spool.\r
+\r
+ 2) A client changes the flags on a message, for example, when you\r
+read a message or\r
+    mark it as deleted. Maildir stores flags in filenames.\r
+\r
+ 3) Message flags are updated on the IMAP server (for example when you\r
+mark a message\r
+    as read in gmail). Offlineimap keeps message flags synchronized.\r
+If you mark a\r
+    local message as read then the change is propagated to the IMAP\r
+server and vice\r
+    versa.\r
+\r
+ -- Jan\r