The branch main has been updated by gahr: URL: https://cgit.FreeBSD.org/src/commit/?id=84dd0acd1c8c93b8e5074f895a30dc49bc00c8d3
commit 84dd0acd1c8c93b8e5074f895a30dc49bc00c8d3 Author: Pietro Cerutti <[email protected]> AuthorDate: 2026-06-01 12:19:57 +0000 Commit: Pietro Cerutti <[email protected]> CommitDate: 2026-06-01 12:19:57 +0000 dma: support relaying to an LMTP endpoint Approved by: bapt Differential Revision: https://reviews.freebsd.org/D55627 Upstream: https://github.com/corecode/dma/pull/152 --- contrib/dma/conf.c | 7 +++++++ contrib/dma/dma.conf | 3 +++ contrib/dma/dma.h | 1 + contrib/dma/net.c | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/dma/conf.c b/contrib/dma/conf.c index 13cfac7a6de4..947e0a6cdec1 100644 --- a/contrib/dma/conf.c +++ b/contrib/dma/conf.c @@ -198,6 +198,8 @@ parse_conf(const char *config_path) config.authpath= data; else if (strcmp(word, "CERTFILE") == 0 && data != NULL) config.certfile = data; + else if (strcmp(word, "LMTP") == 0 && data == NULL) + config.features |= LMTP; else if (strcmp(word, "MAILNAME") == 0 && data != NULL) config.mailname = data; else if (strcmp(word, "MASQUERADE") == 0 && data != NULL) { @@ -257,5 +259,10 @@ parse_conf(const char *config_path) /* NOTREACHED */ } + if ((config.features & LMTP) && (config.features & (TLS_OPP | STARTTLS | SECURETRANSFER))) { + errlogx(EX_CONFIG, "%s: LMTP does not support TLS", config_path); + /* NOTREACHED */ + } + fclose(conf); } diff --git a/contrib/dma/dma.conf b/contrib/dma/dma.conf index fa95fc1a0c22..e5f414b235bf 100644 --- a/contrib/dma/dma.conf +++ b/contrib/dma/dma.conf @@ -68,3 +68,6 @@ # Directly forward the mail to the SMARTHOST bypassing aliases and local delivery #NULLCLIENT + +# Use LMTP instead of SMTP for relaying +#LMTP diff --git a/contrib/dma/dma.h b/contrib/dma/dma.h index 9e7f6cd2c431..ae03075c0892 100644 --- a/contrib/dma/dma.h +++ b/contrib/dma/dma.h @@ -70,6 +70,7 @@ #define FULLBOUNCE 0x040 /* Bounce the full message */ #define TLS_OPP 0x080 /* Opportunistic STARTTLS */ #define NULLCLIENT 0x100 /* Nullclient support */ +#define LMTP 0x400 /* Use LMTP instead of SMTP with the relay */ #ifndef CONF_PATH #error Please define CONF_PATH diff --git a/contrib/dma/net.c b/contrib/dma/net.c index 0079875a22e0..02a31e9673a7 100644 --- a/contrib/dma/net.c +++ b/contrib/dma/net.c @@ -390,7 +390,7 @@ int perform_server_greeting(int fd, struct smtp_features* features) { Send EHLO XXX allow HELO fallback */ - send_remote_command(fd, "EHLO %s", hostname()); + send_remote_command(fd, "%s %s", config.features & LMTP ? "LHLO" : "EHLO", hostname()); char buffer[EHLO_RESPONSE_SIZE]; memset(buffer, 0, sizeof(buffer));
