From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 499326DE0B2F for ; Mon, 31 Aug 2015 10:27:48 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Level: X-Spam-Status: No, score=-2.301 tagged_above=-999 required=5 tests=[AWL=0.550, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9J50nmrL0pfj for ; Mon, 31 Aug 2015 10:27:46 -0700 (PDT) Received: from market.scs.stanford.edu (market.scs.stanford.edu [171.66.3.10]) by arlo.cworth.org (Postfix) with ESMTPS id 231326DE0AC2 for ; Mon, 31 Aug 2015 10:27:46 -0700 (PDT) Received: from market.scs.stanford.edu (localhost.scs.stanford.edu [127.0.0.1]) by market.scs.stanford.edu (8.14.7/8.14.7) with ESMTP id t7VHRbWX015282; Mon, 31 Aug 2015 10:27:37 -0700 (PDT) Received: (from dm@localhost) by market.scs.stanford.edu (8.14.7/8.14.7/Submit) id t7VHRaWF016532; Mon, 31 Aug 2015 10:27:36 -0700 (PDT) X-Authentication-Warning: market.scs.stanford.edu: dm set sender to return-8va43byzm2pw5643unfnu6c7i6@ta.scs.stanford.edu using -f From: dm-list-email-notmuch@scs.stanford.edu To: Amadeusz =?utf-8?B?xbtvxYJub3dza2k=?= Subject: Re: muchsync files renames In-Reply-To: <87k2sbmzww.fsf@freja.aidecoe.name> References: <878u93ujdo.fsf@freja.aidecoe.name> <876146o920.fsf@ta.scs.stanford.edu> <871teu8kdd.fsf@freja.aidecoe.name> <87oahxojlv.fsf@ta.scs.stanford.edu> <87vbbwnbb4.fsf@freja.aidecoe.name> <87io7wr50y.fsf@ta.scs.stanford.edu> <87k2sbmzww.fsf@freja.aidecoe.name> Reply-To: David Mazieres expires 2015-11-29 PST Date: Mon, 31 Aug 2015 10:27:36 -0700 Message-ID: <87oahnmkqf.fsf@ta.scs.stanford.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 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: Mon, 31 Aug 2015 17:27:48 -0000 Amadeusz =C5=BBo=C5=82nowski writes: >> So... based on all the evidence so fare the culprit seems to be that >> something is moving mail files into your Spam folder on the client. >> If that rings any bells and solves the problem, great. If not, here >> is what we need to do to track it down further. > > I have followed you hints to track down the issue. All of these > messages are spam. What I suspect follows. > > All of these files have been placed to new/ subdir by maildrop and > during posthook (afew) have been stripped of any tags besides 'spam' > tag, in particular 'unread' tag has been removed, but files still remain > in new/ subdir. So... what had to happen is that during muchsync these > messages have been discovered as already read, so they don't belong to > new/ but must be moved to cur/. And this is what happened on client > side. During next muchsync these changes had to be pushed to server, > i.e. move from new/ to cur/. Right. Muchsync checks to see if maildir.synchronize_flags is true on the client. If it is, then muchsync calls notmuch_message_tags_to_maildir_flags after setting the flags (which is the same as what would happen if you set the tags manually with the "notmuch tag" command). A maildir file in the new/ directory can't have any tags (except the implicit unread flag, which is indicated by the absence of "S" in the end of the filename). So the notmuch_message_tags_to_maildir_flags() function is renaming the file to the cur subdirectory, and then propagating this rename back to the server. The one thing I'm still unclear on is whether afew is running on the client of the server. If you are running it on the client, then this makes sense. If you are running it on the server, then somehow afew must not be respecting the maildir.synchronize_flags setting. Otherwise, the file should already be moved to the cur directory after having the unread tag stripped off on the server. I guess the other option is that your maildir.synchronize_flags false on the server and true on the client. > So if my assumptions are correct, actually there is no issue! I would > just have to adjust afew filtering to prevent this behaviour. Right. You could have afew preserve the unread flag on spam. Alternatively, you could just disable maildir.synchronize_flags on both the client and server. Finally, you could just accept the performance penalty, as one would hope that this is a one-time thing and that usually you don't have 5000 new spam messages every time you synchronize your mail. David