From: Timo Sirainen Date: Wed, 25 Mar 2020 14:00:08 +0000 (+0200) Subject: imap: SETMETADATA - Explicitly support using atoms for values X-Git-Tag: 2.3.14.rc1~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=923362d27d9b2428e301614673cb0efba3bf928f;p=thirdparty%2Fdovecot%2Fcore.git imap: SETMETADATA - Explicitly support using atoms for values Required to keep atoms working (and especially not assert-crashing) after the following imap_arg_get_nstring() change. --- diff --git a/src/imap/cmd-setmetadata.c b/src/imap/cmd-setmetadata.c index eb18dfd578..a0ae56e027 100644 --- a/src/imap/cmd-setmetadata.c +++ b/src/imap/cmd-setmetadata.c @@ -177,7 +177,12 @@ cmd_setmetadata_entry(struct imap_setmetadata_context *ctx, if (ctx->failed) return 1; i_zero(&value); - value.value = imap_arg_as_nstring(entry_value); + /* NOTE: The RFC doesn't allow atoms as value, but since + 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)) + value.value = imap_arg_as_nstring(entry_value); ret = imap_metadata_set(ctx->trans, entry_name, &value); if (ret < 0) { /* delay reporting the failure so we'll finish