]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: lmtp-commands - Drop XRCPTFORWARD parameter once processed.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 30 Mar 2021 22:06:29 +0000 (00:06 +0200)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 20 Apr 2021 10:30:17 +0000 (12:30 +0200)
This prevents it from popping up elsewhere. This for example crudely fixes a
problem in the proxy where XRCPTFORWARD was sent even without backend server support.

src/lmtp/lmtp-commands.c

index cbafa644cc969f23f8277e360dd5cb4d12d52c30..34be6586c5152b1e4f2889e15548d3c7079ebaf6 100644 (file)
@@ -67,6 +67,10 @@ cmd_rcpt_handle_forward_fields(struct smtp_server_cmd_ctx *cmd,
        if (ret == 0)
                return 0;
 
+       /* Drop the parameter */
+       (void)smtp_params_rcpt_drop_extra(&rcpt->params,
+                                         LMTP_RCPT_FORWARD_PARAMETER, NULL);
+
        /* Check the real IP rather than the proxied client IP, since XCLIENT
           command will update that, thereby making it untrusted. Unlike the
           XCLIENT command, the RCPT forward parameter needs to be used after