chiark / gitweb /
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.