NULL characters in Sent messages/messagefiles

Janne Peltonen janne.peltonen at helsinki.fi
Fri Mar 15 10:15:04 EDT 2013


Hi!

I've run into a weird problem. Apparently, sometimes the web-based IMAP client
IMP fucks up the MIME headers of a part of a multipart message (will file an
IMP bug on that soon), so that if the content type of an attachment is
text/plain and encoding is utf-16 (little endian), the header ends up being
partially encoded as utf-16 (little endian).  But the header of the MIME part
shouldn't contain NUL characters, so Cyrus says "Message contains NUL
characters" and rejects the message when IMP tries to save it to the Sent
folder.

Except not always. Since last week, when I upgraded one of my murder backend
servers from 2.4.12 to 2.4.17, sometimes the NUL bytes creep through. Like so:

--clip--
--=_pRVOz2N9C9oTNFcAA1MfBg1
Content-Type: text/plain; charset=u^@t^@f^@-^@1^@6^@l^@e^@;
 name=m^@a^@a^@l^@a^@m^@p^@o^@1^@b^@.^@t^@x^@t
Content-Disposition: attachment; filename=m^@a^@a^@l^@a^@m^@p^@o^@1^@b^@.^@t^@x^@t^@;
 size=146736
Content-Transfer-Encoding: q^@u^@o^@t^@e^@d^@-^@p^@r^@i^@n^@t^@a^@b^@l^@e
--clip--

(The ^@:s stand for NUL characters. Weird thing is, the
Content-Transfer-Encoding seems to be missing one NUL.)

Would anyone have any idea what's going on: in what kind of circumstances would
Cyrus accept NUL characters in a MIME part header?

All the frontends are at version 2.4.16, if that's any help.

I've been trying to reproduce the problem, but haven't been able to find the
exact conditions :( The irritating thing is, when this happens (NUL bytes in
mime part headers or otherwise corrupted MIME parts), Cyrus ends up counting
the size of the message wrong and replication gets stuck... (sync_support that
makes the sanity checks that the message on disk is the same as the message
referred to in cyrus.index counts the message size using stat(), but apparently
the size that ends up in cyrus.index is counted somehow differently).


--Janne
-- 
Janne Peltonen <janne.peltonen at helsinki.fi> PGP Key ID: 0x9CFAC88B
Please consider membership of the Hospitality Club (http://www.hospitalityclub.org)


More information about the Info-cyrus mailing list