From: Timo Sirainen Date: Mon, 3 May 2021 10:15:17 +0000 (+0300) Subject: imap: Fix using SETMETADATA NIL to unset value X-Git-Tag: 2.3.14.1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01863f98d83bfd35839b705bd6127c993ab5b97e;p=thirdparty%2Fdovecot%2Fcore.git imap: Fix using SETMETADATA NIL to unset value Broken by 923362d27d9b2428e301614673cb0efba3bf928f --- diff --git a/src/imap/cmd-setmetadata.c b/src/imap/cmd-setmetadata.c index a0ae56e027..c21d1e2ae2 100644 --- a/src/imap/cmd-setmetadata.c +++ b/src/imap/cmd-setmetadata.c @@ -181,7 +181,9 @@ cmd_setmetadata_entry(struct imap_setmetadata_context *ctx, Dovecot has traditionally supported it this is kept for backwards compatibility just in case some client is using it. */ - if (!imap_arg_get_atom(entry_value, &value.value)) + if (entry_value->type == IMAP_ARG_NIL) + ; + else if (!imap_arg_get_atom(entry_value, &value.value)) value.value = imap_arg_as_nstring(entry_value); ret = imap_metadata_set(ctx->trans, entry_name, &value); if (ret < 0) {