Arsnael commented on code in PR #2536:
URL: https://github.com/apache/james-project/pull/2536#discussion_r1867253132
##########
protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/ReceivedDataLineFilter.java:
##########
@@ -19,19 +19,45 @@
package org.apache.james.protocols.lmtp.core;
import org.apache.james.protocols.smtp.SMTPSession;
+import org.apache.james.protocols.smtp.core.ReceivedHeaderGenerator;
/**
* {@link ReceivedDataLineFilter} which will add the Received header to the
message
*/
public class ReceivedDataLineFilter extends
org.apache.james.protocols.smtp.core.ReceivedDataLineFilter {
private static final String SERVICE_TYPE = "LMTP";
-
- /**
- * Always returns <code>LMTP</code>
- */
- @Override
- protected String getServiceType(SMTPSession session, String heloMode) {
- return SERVICE_TYPE;
+ private static final String SERVICE_TYPE_AUTH = "LMTPA";
+ private static final String SERVICE_TYPE_SSL = "LMTPS";
+ private static final String SERVICE_TYPE_SSL_AUTH = "LMTPSA";
+
+ public ReceivedDataLineFilter() {
+ super(new ReceivedHeaderGenerator() {
+
+ /**
+ * Always returns <code>LMTP</code>
+ */
+ @Override
+ protected String getServiceType(SMTPSession session, String
heloMode) {
+ // Not successful auth
+ if (session.getUsername() == null) {
+ if (session.isTLSStarted()) {
+ return SERVICE_TYPE_SSL;
+ } else {
+ return SERVICE_TYPE;
+ }
+ } else {
+ // See RFC3848:
+ // The new keyword "ESMTPA" indicates the use of ESMTP
when the SMTP
+ // AUTH [3] extension is also used and authentication is
successfully achieved.
+ if (session.isTLSStarted()) {
+ return SERVICE_TYPE_SSL_AUTH;
+ } else {
+ return SERVICE_TYPE_SSL;
Review Comment:
Was I wrong here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]