cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
531 stars 146 forks source link

BINARY: Incorrect decoding of non-encoded content #1748

Open brong opened 8 years ago

brong commented 8 years ago

From: alec Bugzilla-Id: 3932 Version: 2.5.x (next) Owner: Bron Gondwana

brong commented 8 years ago

From: alec

I have a message where text/html part has "Content-Transfer-Encoding: quoted-printable" header specified, but the body is not encoded at all. When using FETCH with BINARY extension cyrus returns malformed content.

I agree that the message is malformed and the result might not be parseable, but in this case something strange happens.

Sample original:

<img src="cid:1462183084572724ac1c098841070740@domain.tld" alt="" width="68" height="70" />

is returned as:

<img src.id:1462183084572724ac1c098841070740@domain.tld" alt width.8" height.0" />

If cyrus could not replace =XX sequences where XX is not numeric the result would be equal to the original. And that's what I would expect. Returning an error would also be an acceptable solution.

brong commented 8 years ago

From: alec

BTW, the same message on dovecot:

C: A0005 UID FETCH 291 (BINARY.PEEK[2.1]) S: * 83 FETCH (UID 291) S: A0005 NO [UNKNOWN-CTE] Invalid data in MIME part