1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

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
This commit is contained in:
Pietro Cerutti
2026-06-01 12:19:57 +00:00
parent dfd2273d27
commit 84dd0acd1c
4 changed files with 12 additions and 1 deletions
+7
View File
@@ -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);
}
+3
View File
@@ -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
+1
View File
@@ -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
+1 -1
View File
@@ -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));