This is an automated email from the ASF dual-hosted git repository.

chibenwa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new 972dcf51de [ENHANCEMENT] Support StartTLS, SSL, Proxy protocol for 
LMTP (#3043)
972dcf51de is described below

commit 972dcf51de1a237ab1a40a0c0d0eec9e58a825f1
Author: Benoit TELLIER <[email protected]>
AuthorDate: Fri May 22 16:16:07 2026 +0200

    [ENHANCEMENT] Support StartTLS, SSL, Proxy protocol for LMTP (#3043)
---
 docs/modules/servers/partials/configure/smtp.adoc                | 4 +---
 docs/modules/servers/partials/configure/ssl.adoc                 | 6 ++----
 .../java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java   | 2 ++
 .../main/java/org/apache/james/lmtpserver/netty/LMTPServer.java  | 9 +++------
 4 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/docs/modules/servers/partials/configure/smtp.adoc 
b/docs/modules/servers/partials/configure/smtp.adoc
index c5da1dffa9..eb687975e2 100644
--- a/docs/modules/servers/partials/configure/smtp.adoc
+++ b/docs/modules/servers/partials/configure/smtp.adoc
@@ -216,11 +216,9 @@ Consult this 
link:{sample-configuration-prefix-url}/lmtpserver.xml[example] for
 The LMTP service is configured in the file `lmtpserver.xml`.
 It contains one `lmtpservers` element that can contain multiple `lmtpserver` 
elements.
 
-The `lmtpserver` element can be configured using most of the common options 
described xref:{pages-path}/configure/server.adoc[here].
+The `lmtpserver` element can be configured using the common options described 
xref:{pages-path}/configure/server.adoc[here].
 Additional settings are described below.
 
-**Note:** Neither any form of TLS nor proxies are supported.
-
 .`lmtpserver` element
 |===
 | Property Name | Explanation
diff --git a/docs/modules/servers/partials/configure/ssl.adoc 
b/docs/modules/servers/partials/configure/ssl.adoc
index 46c4f99da8..c34381bbcf 100644
--- a/docs/modules/servers/partials/configure/ssl.adoc
+++ b/docs/modules/servers/partials/configure/ssl.adoc
@@ -122,9 +122,7 @@ When trying to deliver emails to another email server using 
implicit TLS, James
 
 | LMTP
 | Local MX
-| insecure: 24, no TLS port defined
-
-TLS for LMTP is not supported by James.
+| insecure: 24, no TLS port defined by RFC
 
 |===
 
@@ -136,7 +134,7 @@ Every email server **must** therefore offer SMTP on port 25.
 You may choose to additionally offer SMTP with implicit TLS on port 465 as 
some email servers (e.g., James) also try that endpoint.
 Note that you need to move the SMTP submission service with implicit TLS to 
another port in that case (this works well as it is only used by MUAs).
 
-As James does not support TLS or authentication for LMTP,
+As James does not support authentication for LMTP,
 the port **must only be exposed** to the local SMTP server that uses it.
 
 **We strongly recommend that you enable STARTTLS for all services that you 
choose to offer without implicit TLS.**
diff --git 
a/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java
 
b/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java
index 90632273bc..aac876e098 100644
--- 
a/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java
+++ 
b/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/CoreCmdHandlerLoader.java
@@ -35,6 +35,7 @@ import 
org.apache.james.protocols.smtp.core.ReceivedDataLineFilter;
 import org.apache.james.protocols.smtp.core.RsetCmdHandler;
 import org.apache.james.protocols.smtp.core.VrfyCmdHandler;
 import org.apache.james.protocols.smtp.core.esmtp.MailSizeEsmtpExtension;
+import org.apache.james.protocols.smtp.core.esmtp.StartTlsCmdHandler;
 import org.apache.james.protocols.smtp.core.log.HookResultLogger;
 import org.apache.james.smtpserver.AuthRequiredToRelayRcptHook;
 import org.apache.james.smtpserver.JamesDataCmdHandler;
@@ -61,6 +62,7 @@ public class CoreCmdHandlerLoader implements HandlersPackage {
             RsetCmdHandler.class.getName(),
             VrfyCmdHandler.class.getName(),
             MailSizeEsmtpExtension.class.getName(),
+            StartTlsCmdHandler.class.getName(),
             AuthRequiredToRelayRcptHook.class.getName(),
             PostmasterAbuseRcptHook.class.getName(),
             ReceivedDataLineFilter.class.getName(),
diff --git 
a/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java
 
b/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java
index 63ac70db6b..492b3e520e 100644
--- 
a/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java
+++ 
b/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java
@@ -32,9 +32,8 @@ import org.apache.james.protocols.lib.handler.HandlersPackage;
 import org.apache.james.protocols.lib.netty.AbstractProtocolAsyncServer;
 import org.apache.james.protocols.lmtp.LMTPConfiguration;
 import org.apache.james.protocols.netty.AbstractChannelPipelineFactory;
+import 
org.apache.james.protocols.netty.AllButStartTlsLineChannelHandlerFactory;
 import org.apache.james.protocols.netty.ChannelHandlerFactory;
-import org.apache.james.protocols.netty.Encryption;
-import 
org.apache.james.protocols.netty.LineDelimiterBasedChannelHandlerFactory;
 import org.apache.james.protocols.smtp.SMTPProtocol;
 import org.apache.james.smtpserver.ExtendedSMTPSession;
 import org.apache.james.smtpserver.netty.SMTPChannelInboundHandler;
@@ -162,9 +161,7 @@ public class LMTPServer extends AbstractProtocolAsyncServer 
implements LMTPServe
                 return new ExtendedSMTPSession(lmtpConfig, transport);
             }
         };
-        boolean proxyRequired = true;
-        Encryption noEncryption = null;
-        return new SMTPChannelInboundHandler(transport, noEncryption, 
!proxyRequired, lmtpMetrics, lmtpChannelGroup);
+        return new SMTPChannelInboundHandler(transport, getEncryption(), 
proxyRequired, lmtpMetrics, lmtpChannelGroup);
     }
 
     @Override
@@ -179,7 +176,7 @@ public class LMTPServer extends AbstractProtocolAsyncServer 
implements LMTPServe
 
     @Override
     protected ChannelHandlerFactory createFrameHandlerFactory() {
-        return new 
LineDelimiterBasedChannelHandlerFactory(AbstractChannelPipelineFactory.MAX_LINE_LENGTH);
+        return new AllButStartTlsLineChannelHandlerFactory("starttls", 
AbstractChannelPipelineFactory.MAX_LINE_LENGTH);
     }
 
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to