[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21182: 25.0.50; gnus: every other unread message is marked as read o
From: |
Lars Ingebrigtsen |
Subject: |
bug#21182: 25.0.50; gnus: every other unread message is marked as read on each nnimap group refresh |
Date: |
Tue, 09 Feb 2016 11:57:09 +1100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Nix <nix@esperi.org.uk> writes:
> It's hard to say -- I reverted the patch locally immediately. The
> problem is that whenever this goes wrong, 50% of my unread email gets
> marked as read, with no obvious way to reverse this. This is rather a
> high price to pay for replicating a bug :)
>
> I have some sacrificial folders I could give up to the cause -- I'll see
> if I can make things go wrong with them in the next day or so.
I just don't understand how the following patch could have this
effect...
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index ced5561..8e81abc 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -166,14 +166,21 @@ nnimap-buffer
(nnimap-find-process-buffer nntp-server-buffer))
(defun nnimap-header-parameters ()
- (format "(UID RFC822.SIZE BODYSTRUCTURE %s)"
- (format
+ (let (params)
+ (push "UID" params)
+ (push "RFC822.SIZE" params)
+ (when (nnimap-capability "X-GM-EXT-1")
+ (push "X-GM-LABELS" params))
So it only adds that to the params if the server supports it...
+ (push "BODYSTRUCTURE" params)
+ (push (format
(if (nnimap-ver4-p)
"BODY.PEEK[HEADER.FIELDS %s]"
"RFC822.HEADER.LINES %s")
(append '(Subject From Date Message-Id
References In-Reply-To Xref)
- nnmail-extra-headers))))
+ nnmail-extra-headers))
+ params)
+ (format "%s" (nreverse params))))
So on non-Gmail servers the result should be identical...
- (let (article lines size string)
+ (let (article lines size string labels)
(block nil
(while (not (eobp))
(while (not (looking-at "\\* [0-9]+ FETCH"))
@@ -232,6 +239,9 @@ nnimap-transform-headers
t)
(match-string 1)))
(beginning-of-line)
+ (when (search-forward "X-GM-LABELS" (line-end-position) t)
+ (setq labels (ignore-errors (read (current-buffer)))))
+ (beginning-of-line)
Again, it should have no effect on non-Gmail...
(when lines
(insert (format "Lines: %s\n" lines)))
+ (when labels
+ (insert (format "X-GM-LABELS: %s\n" labels)))
;; Most servers have a blank line after the headers, but
;; Davmail doesn't.
(unless (re-search-forward "^\r$\\|^)\r?$" nil t)
And ditto. So it's a mystery to me why that patch should affect
anything unless you're using Gmail..
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no