]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-metadata: setting metadata literal value does not delete it
authorMarkus Valentin <markus.valentin@open-xchange.com>
Fri, 2 Aug 2019 13:57:09 +0000 (15:57 +0200)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Fri, 2 Aug 2019 14:08:23 +0000 (16:08 +0200)
Only if value and value_stream are NULL the metadata can be unset.

src/lib-imap-storage/imap-metadata.c

index 260684877d357af6d4ce1eec4efb9bece2d4a10f..03d5b571a77beb8ab087267604c9c8f3f6dc1223 100644 (file)
@@ -143,7 +143,7 @@ int imap_metadata_set(struct imap_metadata_transaction *imtrans,
 
        if (imap_metadata_get_mailbox_transaction(imtrans) < 0)
                return -1;
-       return (value->value == NULL ?
+       return (value->value == NULL && value->value_stream == NULL ?
                mailbox_attribute_unset(imtrans->trans, type, key) :
                mailbox_attribute_set(imtrans->trans, type, key, value));
 }