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