]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: lowercase attribute names before trying to parse them
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 13 Sep 2016 07:33:06 +0000 (03:33 -0400)
committerGitLab <gitlab@git.dovecot.net>
Wed, 14 Sep 2016 11:43:35 +0000 (14:43 +0300)
This now matches what the imap server does.

src/doveadm/doveadm-mail-mailbox-metadata.c

index 3b682ed76bad9947e3a77473516d908b44e94749..aadb230028acfbbdbf465068e2621c666b402420 100644 (file)
@@ -62,6 +62,8 @@ cmd_mailbox_metadata_parse_key(const char *arg,
                               enum mail_attribute_type *type_r,
                               const char **key_r)
 {
+       arg = t_str_lcase(arg);
+
        if (strncmp(arg, "/private/", 9) == 0) {
                *type_r = MAIL_ATTRIBUTE_TYPE_PRIVATE;
                *key_r = arg + 9;
@@ -78,7 +80,6 @@ cmd_mailbox_metadata_parse_key(const char *arg,
                i_fatal_status(EX_USAGE, "Invalid metadata key '%s': "
                               "Must begin with /private or /shared", arg);
        }
-       *key_r = t_str_lcase(*key_r);
 }
 
 static void