From 01863f98d83bfd35839b705bd6127c993ab5b97e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 3 May 2021 13:15:17 +0300 Subject: [PATCH] imap: Fix using SETMETADATA NIL to unset value Broken by 923362d27d9b2428e301614673cb0efba3bf928f --- src/imap/cmd-setmetadata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.47.3