I have a large, sparse imap folder with read and unread articles. In recent versions of Emacs, when I visit this group, a set of articles in the middle (when sorted by number) are marked as read with the `O' mark. I have bisected this to the following commit: commit ea640581bad1c596f657ca405f6c97e1b4fc4b11 (refs/bisect/bad) Author: Lars Ingebrigtsen Date: Thu Jun 23 11:22:29 2022 +0200 Ensure that nnimap doesn't send too long lines to the server * lisp/gnus/nnimap.el (nnimap-retrieve-headers): Don't send too-long lines to the server (bug#56138). I've attached the FETCH command used by last "good" version and the ones issued by a build with the offending commit. In the "bad" version, the articles from 60795 until 63651 are marked as read with an `O'. Good: