Subject: 27.1; imap request exceeds maximum line length

From: Arnaud Giersch <[email-masked]>
Date: Wed, 22 Jun 2022 10:48:47 +0200

Package: gnus

Hi,

When trying to enter a nnimap group with many unread messages, Gnus
hangs with, in the echo area, the message: "nnimap read 0k from [server]".

In fact, a very long IMAP request is generated from function
'nnimap-retrieve-headers' (see the attached logs for an example), and
the server replies with "* BAD maximum line length exceeded".
In this case, the server (Zimbra) rejects lines longer than 10240 octets.

IMHO, Gnus should split the request into smaller ones.
RFC 7162 (Section 4. Long Command Lines) recommends a maximum length of
8192 octets. [ https://www.rfc-editor.org/rfc/rfc7162.html#section-4 ]

As a side note, if Gnus could detect and report "BAD" replies from the
server, it would make the understanding of such issues more easy.

Regards,
Arnaud Giersch

In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2021-02-09, modified by Debian built on 3df710f593d9
Repository revision: b0229d4bbaea7fcddffced393512c650212830db
Repository branch: deb/emacs/d/sid/master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)