From 1abb196660516f85b2ec13673aa28e6cf8a24b41 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 9 Sep 2015 16:05:36 +0200 Subject: Add support for the Binary Content extension [RFC3516]. Unfortunately as of Debian Wheezy it doesn't work for Dovecot with COMPRESS=DEFLATE [RFC4978] and non-synchronizing literals. perl -e 'use Compress::Raw::Zlib; print "a COMPRESS DEFLATE\r\n"; sleep 1; my $d = new Compress::Raw::Zlib::Deflate( -WindowBits => -15 ); $d->deflate("b APPEND TRASH ~{1+}\r\nx\r\n", my $buf); print $buf; $d->flush($buf, Z_SYNC_FLUSH); print $buf; sleep 1; ' | /usr/lib/dovecot/imap imap(guilhem): Panic: stream doesn't support seeking backwards Interestingly, it works just fine for non-binary literals: perl -e 'use Compress::Raw::Zlib; print "a COMPRESS DEFLATE\r\n"; sleep 1; my $d = new Compress::Raw::Zlib::Deflate( -WindowBits => -15 ); $d->deflate("b APPEND TRASH {1+}\r\nx\r\n", my $buf); print $buf; $d->flush($buf, Z_SYNC_FLUSH); print $buf; sleep 1; ' | /usr/lib/dovecot/imap However I can't reproduce the problem Dovecot 2.2.18 and Debian Sid (but it doesn't help to install Dovecot from testing to my Wheezy box.) --- interimap.1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'interimap.1') diff --git a/interimap.1 b/interimap.1 index dc3b49b..e552351 100644 --- a/interimap.1 +++ b/interimap.1 @@ -324,6 +324,18 @@ Whether to redirect \fIcommand\fR's standard error to \(lq/dev/null\(rq for type \fItype\fR=tunnel. (Default: \(lqNO\(rq.) +.TP +.I use-binary +Whether to use the Binary Content extension [RFC3516] in FETCH and +APPEND commands. +This is useful for binary attachments for instance, as it avoids the +overhead caused by base64 encodings. Moreover if the IMAP COMPRESS +extension is enabled, full flush points are placed around large non-text +literals to empty the compression dictionary. +This option is only available in the default section, and is ignored if +either server does not advertize \(lqBINARY\(rq in its capability list. +(Default: \(lqYES\(rq.) + .SH KNOWN BUGS AND LIMITATIONS .IP \[bu] -- cgit v1.2.3