From 899d11722e9494b64e5ca9f701ebab342c8cc504 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 31 Mar 2021 00:06:29 +0200 Subject: [PATCH] lmtp: lmtp-commands - Drop XRCPTFORWARD parameter once processed. 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lmtp/lmtp-commands.c b/src/lmtp/lmtp-commands.c index cbafa644cc..34be6586c5 100644 --- a/src/lmtp/lmtp-commands.c +++ b/src/lmtp/lmtp-commands.c @@ -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 -- 2.47.3