]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
IMAP: ESORT extension was implemented wrong.
authorTimo Sirainen <tss@iki.fi>
Fri, 20 Mar 2009 16:28:37 +0000 (12:28 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 20 Mar 2009 16:28:37 +0000 (12:28 -0400)
--HG--
branch : HEAD

src/imap/cmd-sort.c

index bf14064c5e1259e5f01a7017f533659b3a912f50..43e23a804e7d6beefe9956c7515f30df2e4087ae 100644 (file)
@@ -102,6 +102,14 @@ bool cmd_sort(struct client_command_context *cmd)
        if (!client_verify_open_mailbox(cmd))
                return TRUE;
 
+       ctx = p_new(cmd->pool, struct imap_search_context, 1);
+       ctx->cmd = cmd;
+
+       if ((ret = cmd_search_parse_return_if_found(ctx, &args)) <= 0) {
+               /* error / waiting for unambiguity */
+               return ret < 0;
+       }
+
        /* sort program */
        if (args->type != IMAP_ARG_LIST) {
                client_send_command_error(cmd, "Invalid sort argument.");
@@ -121,14 +129,6 @@ bool cmd_sort(struct client_command_context *cmd)
        charset = IMAP_ARG_STR(args);
        args++;
 
-       ctx = p_new(cmd->pool, struct imap_search_context, 1);
-       ctx->cmd = cmd;
-
-       if ((ret = cmd_search_parse_return_if_found(ctx, &args)) <= 0) {
-               /* error / waiting for unambiguity */
-               return ret < 0;
-       }
-
        ret = imap_search_args_build(cmd, args, charset, &sargs);
        if (ret <= 0)
                return ret < 0;