From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#50450: 28.0.50; nnmaildir cannot find article file Date: Wed, 15 Sep 2021 09:03:16 +0000 Message-ID: <871r5q43e3.fsf@posteo.net> References: <87wnns7q2g.fsf@posteo.net> <87ilzccsxk.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31732"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50450@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 15 11:07:41 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQQtI-00081w-L9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 11:07:40 +0200 Original-Received: from localhost ([::1]:44198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQQtH-0003VT-B0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 05:07:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQQpu-0000sN-DI for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 05:04:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39320) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQQpm-0004aq-Q1 for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 05:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQQpm-0001Q9-IX; Wed, 15 Sep 2021 05:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 15 Sep 2021 09:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50450 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 50450-submit@debbugs.gnu.org id=B50450.16316966075409 (code B ref 50450); Wed, 15 Sep 2021 09:04:02 +0000 Original-Received: (at 50450) by debbugs.gnu.org; 15 Sep 2021 09:03:27 +0000 Original-Received: from localhost ([127.0.0.1]:50865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQQpD-0001PB-Fd for submit@debbugs.gnu.org; Wed, 15 Sep 2021 05:03:27 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:37819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQQpA-0001Op-Lv for 50450@debbugs.gnu.org; Wed, 15 Sep 2021 05:03:25 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 455FC240026 for <50450@debbugs.gnu.org>; Wed, 15 Sep 2021 11:03:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1631696598; bh=3GWGWMS8TOQDuVTzjJdQU7pRhRT4PCvwkpESY66WPas=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=fICucPpZRwewEhA93t9Svp6UOjthm2lV7hpUSYHdj+0SnjKmlwWuXSBh+3DIp9gZF 44uDfsGCXMUZ9/Rj5L8A5pNPsY9dOhqnP5MGqzmjh8ecD1ur185w6UnWpkKzm/pAOL fr3bGL0nwPV08Y5bcYMGnfGaBPQKi4dOFtOVtiK8Yf/JEIJuVzdWvgRsK4QpWXbRKL GOXjOLR+xDVhL1SHc6/9UoHQBkQOFmOhI3gG6kZvDbNf4tSK06Y4Dz9wxmtIhKxv3D 3tLl20Ko5aySqI6WZEV/PDgvRyn7I40c4vX15f96JkjHRCffHHi/qdE4Dio6WUerpw uKJLMw231XRbg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4H8Z4j2ccpz6tmD; Wed, 15 Sep 2021 11:03:17 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <87ilzccsxk.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 07 Sep 2021 17:21:43 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214369 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >>>From time to time I get error messages like >> >> nnmaildir--article-set-flags: Couldn=E2=80=99t find article file >> /home/philip/Mail/Pers/Sent/cur/1631002186.M670797P704685Q0.icterid:2,S >> >> when trying to send a message. > > I don't use nnmaildir myself (and I'm not familiar with how maildir > works, really). Can you propose a patch to fix this yourself? :-) I found out that the issue is not the UID, but the flags. Specifically, when I open a message via Gnus, leave it open for a while, perhaps check the message on my phone or some other device, and then return to Gnus, it might have happened that the flags (included in the file-name) were updated by mbsync. This patch attempts to find a similar file, and renames that file instead of the one Gnus remembered. It seems to be working for now, but I'd wait a bit until I had more time to test it before applying it: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Handle-updates-flags-when-setting-flags.patch >From facb1848952d5c844d76844e35da708fda8307c7 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 15 Sep 2021 10:58:50 +0200 Subject: [PATCH] Handle updates flags when setting flags * nnmaildir.el (nnmaildir--article-set-flags): Handle updated flags more gracefully --- lisp/gnus/nnmaildir.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index 171f0813b3..690761a2d6 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -194,7 +194,15 @@ nnmaildir--article-set-flags (article-file (concat curdir prefix suffix)) (new-name (concat curdir prefix new-suffix))) (unless (file-exists-p article-file) - (error "Couldn't find article file %s" article-file)) + (let ((possible (file-expand-wildcards (concat curdir prefix "*")))) + (cond ((length= possible 1) + (unless (string-match-p "\\`\\(.+\\):2,.*?\\'" (car possible)) + (error "Couldn't find updated article file %s" article-file)) + (setq article-file (car possible))) + ((length> possible 1) + (error "Couldn't determine exact article file %s" article-file)) + ((null possible) + (error "Couldn't find article file %s" article-file))))) (rename-file article-file new-name 'replace) (setf (nnmaildir--art-suffix article) new-suffix))) -- 2.30.2 --=-=-= Content-Type: text/plain One possible issue is that nnmaildir--article-set-flags overwrites previous flags that might have been updated elsewhere. -- Philip Kaludercic --=-=-=--