]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: lmtp-proxy - Use port 24 as default for proxy.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 1 Feb 2022 00:33:53 +0000 (01:33 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 1 Mar 2022 11:04:20 +0000 (11:04 +0000)
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.

src/lmtp/lmtp-proxy.c
src/lmtp/lmtp-proxy.h

index 06d3031411ea6b0242d1dc89fead65fec70019a6..f7e062decbdf2ab6bf4f068143a4b1e303af331a 100644 (file)
@@ -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;
 
index 78e1f4a4056e5a4350441aff82978c6e1dab9ceb..5ef71c4c7ddb6006b03709458b6d498b23d660ff 100644 (file)
@@ -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;