chiark / gitweb /
el/dot-emacs.el: Hack Gnus to cope with IMAP literals properly.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 22 Nov 2017 18:57:45 +0000 (18:57 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 22 Nov 2017 18:57:45 +0000 (18:57 +0000)
commitd2d1d5dcee101bfbc96a6240f5f9af1df9ee652f
tree09971988262c30bb5368434076c2471d02939e5f
parentfbc946b7cb685bb47268f036e7fb4ed58ad19cbe
el/dot-emacs.el: Hack Gnus to cope with IMAP literals properly.

The bug manifests when Dovecot encounters a MIME-part header of the form

Content-Description:
BLAH...

Gnus requests `BODYSTRUCTURE' as part of its `FETCH' command.  In the
specific case shown above, Dovecot encodes the description using IMAP
`literal' quoting, as

{LEN}

BLAH...

(The first newline is part of the literal syntax; and the second is part
of the header data.  Actually, the first newline is an IETF-style
carriage-return/line-feed pair, and the second is a bare linefeed, but
that doesn't matter here.)

Gnus has a loop which converts such strings into plain double-quoted
strings, but it can't cope with two consecutive such strings.
Specifically, it ends up with

... " BLAH"| {LEN} ...

with point at the `|', but expects to find at least two characters
before the next `{LEN}'.  Hacky fix: move back by one place before
resuming the search.

Much worse is the need to include the entire function here so that I can
patch it just a little.
el/dot-emacs.el