]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-server: Fixed initializing username for mail commands.
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 22 Mar 2016 07:19:45 +0000 (09:19 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 29 Mar 2016 08:21:11 +0000 (11:21 +0300)
src/doveadm/client-connection.c

index b8bd2040c9904fc5172c1517c16d9ec8d1e39451..ac78acd43260f8767a4a3424d861af8016083316 100644 (file)
@@ -104,7 +104,7 @@ doveadm_mail_cmd_server_parse(const struct doveadm_mail_cmd *cmd,
        mctx = doveadm_mail_cmd_init(cmd, set);
        mctx->full_args = argv+1;
        mctx->proxying = TRUE;
-
+       mctx->cur_username = cctx->username;
        mctx->service_flags |=
                MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
                MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
@@ -149,6 +149,13 @@ doveadm_mail_cmd_server_parse(const struct doveadm_mail_cmd *cmd,
        }
        mctx->args = argv+optind;
 
+       if (mctx->cur_username != NULL) {
+               if (strchr(mctx->cur_username, '*') != NULL ||
+                   strchr(mctx->cur_username, '?') != NULL) {
+                       add_username_header = TRUE;
+               }
+       }
+
        if (doveadm_print_is_initialized() && add_username_header) {
                doveadm_print_header("username", "Username",
                                     DOVEADM_PRINT_HEADER_FLAG_STICKY |