diff --git a/contrib/dma/conf.c b/contrib/dma/conf.c --- a/contrib/dma/conf.c +++ b/contrib/dma/conf.c @@ -198,6 +198,8 @@ 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 @@ /* 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.h b/contrib/dma/dma.h --- 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/dma.conf b/contrib/dma/dma.conf --- 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/net.c b/contrib/dma/net.c --- a/contrib/dma/net.c +++ b/contrib/dma/net.c @@ -390,7 +390,7 @@ 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));