]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Rewind input early enough
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 21 Oct 2016 10:55:42 +0000 (13:55 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Oct 2016 09:17:48 +0000 (12:17 +0300)
Command input needs to be rewinded earlier
in doveadm_mail_next_user.

src/doveadm/doveadm-mail.c

index b8c14839415f00a92121666878e570e79a7cfb31..2d7c4a247f0b4b4030f7ae78198aa1fce45cc24e 100644 (file)
@@ -366,6 +366,8 @@ doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx,
        else
                i_set_failure_prefix("doveadm(%s,%s): ", ip, cctx->username);
        doveadm_cctx_to_storage_service_input(cctx, &input);
+       if (ctx->cmd_input != NULL)
+               i_stream_seek(ctx->cmd_input, 0);
 
        /* see if we want to execute this command via (another)
           doveadm server */
@@ -399,8 +401,6 @@ doveadm_mail_next_user(struct doveadm_mail_cmd_context *ctx,
                return ret;
        }
 
-       if (ctx->cmd_input != NULL)
-               i_stream_seek(ctx->cmd_input, 0);
        if (ctx->v.run(ctx, ctx->cur_mail_user) < 0) {
                i_assert(ctx->exit_code != 0);
        }