[Imap-use] Binary data in IMAP

Dave Cridland dave at cridland.net
Thu May 19 01:49:37 PDT 2005


On Thu May 19 07:47:17 2005, Gopal Kamalanathan (gkamalan) wrote:
> Hi,
>  Do IMAP support binary data?  Can binary data like wav files be
> retrieved using IMAP without encoding?

Technically (or pedantically, at least) speaking, they still do have 
an encoding - binary.

The short answer, as provided already, is that RFC3516 provides this 
capability, and it's reasonably well supported in newer servers, and 
some clients.

However, take note that only attachments may be decoded in this way - 
so while you might find it useful to obtain the message itself (the 
TEXT part, for instance), you can't - only section-part from 
RFC3501's ABNF can be used. Since some message texts are considerably 
shorter when encoded with base64, this is rather unfortunate.

Secondly, there's no LITERAL+ support should you wish to support 
BINARY APPEND commands. So no ~{234+}, basically, and an extra 
round-trip, which may cost you more than the overhead of base64 
encoding prior to the append. Cyrus IMAPd, at least, does support 
that syntax, but use it at your own risk.

And finally, there's no means of detecting BINARY support for a 
particular mailbox - you can hope that the remote server will reject 
a BINARY append instead of offering a + continuation, but that's not 
mandated.

I believe Lyndon Nerenberg is considering an updated version, so 
perhaps all of this will be sorted out later.

Dave.


More information about the Imap-use mailing list