From: Timo Sirainen Date: Wed, 12 Jun 2013 20:01:26 +0000 (+0300) Subject: zlib: Enable only for storages that support MAIL_STORAGE_CLASS_FLAG_BINARY_DATA X-Git-Tag: 2.2.3~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70b67fc19de667a939fe4b7e54de8604a3f370b7;p=thirdparty%2Fdovecot%2Fcore.git zlib: Enable only for storages that support MAIL_STORAGE_CLASS_FLAG_BINARY_DATA --- diff --git a/src/plugins/zlib/zlib-plugin.c b/src/plugins/zlib/zlib-plugin.c index c5538a7cb6..e1d7207cb6 100644 --- a/src/plugins/zlib/zlib-plugin.c +++ b/src/plugins/zlib/zlib-plugin.c @@ -349,6 +349,7 @@ static void zlib_mailbox_allocated(struct mailbox *box) { struct mailbox_vfuncs *v = box->vlast; union mailbox_module_context *zbox; + enum mail_storage_class_flags class_flags = box->storage->class_flags; zbox = p_new(box->pool, union mailbox_module_context, 1); zbox->super = *v; @@ -358,8 +359,8 @@ static void zlib_mailbox_allocated(struct mailbox *box) MODULE_CONTEXT_SET_SELF(box, zlib_storage_module, zbox); - if ((box->storage->class_flags & - MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS) == 0) + if ((class_flags & MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS) == 0 && + (class_flags & MAIL_STORAGE_CLASS_FLAG_BINARY_DATA) != 0) zlib_permail_alloc_init(box, v); }