]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
zlib: Enable only for storages that support MAIL_STORAGE_CLASS_FLAG_BINARY_DATA
authorTimo Sirainen <tss@iki.fi>
Wed, 12 Jun 2013 20:01:26 +0000 (23:01 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 12 Jun 2013 20:01:26 +0000 (23:01 +0300)
src/plugins/zlib/zlib-plugin.c

index c5538a7cb6ddf502fe09af3c597cc5bb3b5086b6..e1d7207cb6051e6770226d53b6d6c55c8c44a301 100644 (file)
@@ -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);
 }