GNU bug report logs - #67890
28.2; nnmaildir silently deletes messages upon expiration

Previous Next

Package: emacs;

Reported by: Łukasz Stelmach <stlman <at> poczta.fm>

Date: Mon, 18 Dec 2023 23:18:02 UTC

Severity: normal

Found in version 28.2

Full log


Message #14 received at 67890 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Łukasz Stelmach <stlman <at> poczta.fm>
Cc: 67890 <at> debbugs.gnu.org
Subject: Re: bug#67890: 28.2; nnmaildir silently deletes messages upon
 expiration
Date: Thu, 04 Jan 2024 08:32:24 -0800
Łukasz Stelmach <stlman <at> poczta.fm> writes:

> I believe I've found a bug leading to a data loss situation.
>
> Steps to reproduce.

Thanks for the very detailed report! Obviously the `nnmaildir--pgname'
problem needs to be fixed, but otherwise it seems like the unlinking
step is also a clear bug: we should not be deleting the message if it
wasn't successfully expired someplace, right?

I'm thinking the end of the `t` clause in the cond there should look
like this:

(when (and (stringp target)
	   (not (string-equal target pgname))) ;; Move it.
  (erase-buffer)
  (nnheader-insert-file-contents nnmaildir--file)
  (let ((group-art (gnus-request-accept-article
		    target nil nil 'no-encode)))
    (if group-art
	(progn
	  (when (consp group-art)
	    ;; Maybe also copy: dormant forward reply save tick
	    ;; (gnus-add-mark? gnus-request-set-mark?)
	    (gnus-group-mark-article-read target (cdr group-art)))
	  ;; Article was successfully moved, delete the original.
	  (nnmaildir--unlink nnmaildir--file)
	  (nnmaildir--expired-article group article))
      ;; Leave it here.
      (setq didnt (cons (nnmaildir--art-num article) didnt)))))

It looks to me like `gnus-request-accept-article` can return a
(group . article) cons, a symbol, or nil for failure. If we get a nil,
we shouldn't remove the original article.

Does that seem reasonable?

Eric




This bug report was last modified 1 year and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.