]> 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)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Mon, 26 Sep 2016 12:08:45 +0000 (08:08 -0400)
This now matches what the imap server does.

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

index b93cbcef8ae64115a22f51dfab3e4e8fcb6be94f..a8ddab6328e7c9859b2dd8988aacbb32ff22cc9f 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