From: Stephan Bosch Date: Tue, 1 Feb 2022 00:33:53 +0000 (+0100) Subject: lmtp: lmtp-proxy - Use port 24 as default for proxy. X-Git-Tag: 2.4.0~4300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a2111bba7ed26eca0f88ece2cbf52e35451f25c;p=thirdparty%2Fdovecot%2Fcore.git lmtp: lmtp-proxy - Use port 24 as default for proxy. LMTP has no officially registered default service port, but 24 is the de-facto standard. When client connects through TCP, the local client port number is used to setup the proxy connection as well. However, when the client connects through a unix socket, there is no port number to use and a default is needed. --- diff --git a/src/lmtp/lmtp-proxy.c b/src/lmtp/lmtp-proxy.c index 06d3031411..f7e062decb 100644 --- a/src/lmtp/lmtp-proxy.c +++ b/src/lmtp/lmtp-proxy.c @@ -915,7 +915,8 @@ int lmtp_proxy_rcpt(struct client *client, } i_zero(&set); - set.set.port = client->local_port; + set.set.port = (client->local_port != 0 ? + client->local_port : LMTP_PROXY_DEFAULT_PORT); set.set.timeout_msecs = LMTP_PROXY_DEFAULT_TIMEOUT_MSECS; set.protocol = SMTP_PROTOCOL_LMTP; diff --git a/src/lmtp/lmtp-proxy.h b/src/lmtp/lmtp-proxy.h index 78e1f4a405..5ef71c4c7d 100644 --- a/src/lmtp/lmtp-proxy.h +++ b/src/lmtp/lmtp-proxy.h @@ -8,6 +8,7 @@ #include "smtp-client.h" #define LMTP_PROXY_DEFAULT_TTL 5 +#define LMTP_PROXY_DEFAULT_PORT 24 struct smtp_server_cmd_ctx; struct smtp_server_cmd_rcpt;