]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Use port 24 if no port has been provided
authorWido den Hollander <wido@widodh.nl>
Sat, 9 Apr 2016 11:43:16 +0000 (13:43 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 8 Aug 2016 12:53:17 +0000 (15:53 +0300)
This allows using the LMTP, IMAP and POP3 proxy on the same
Dovecot installation without the userdb providing the port
to connect to.

TCP port 24 is registered at IANA as: "any private mail system"

LMTP being the Local Mail Transfer Protocol classifies as a private
mail system and thus justifies the usage of port 24.

Prior to this patch the LTMP client would connect to TCP port 0 by
default if the userdb did not provide a port to connect to.

src/lmtp/commands.c

index 56cb94b3fc3a81b3d322b499a0623097e9c84507..bb42d783d50139520ff6517fc518cbfbc261e35e 100644 (file)
@@ -263,6 +263,8 @@ client_proxy_rcpt_parse_fields(struct lmtp_proxy_rcpt_settings *set,
                } else if (strcmp(key, "protocol") == 0) {
                        if (strcmp(value, "lmtp") == 0)
                                set->protocol = LMTP_CLIENT_PROTOCOL_LMTP;
+                               if (!port_set)
+                                       set->port = 24;
                        else if (strcmp(value, "smtp") == 0) {
                                set->protocol = LMTP_CLIENT_PROTOCOL_SMTP;
                                if (!port_set)