james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r487583 - /james/server/trunk/src/java/org/apache/james/smtpserver/core/DataCmdHandler.java
Date Fri, 15 Dec 2006 15:48:29 GMT
Author: norman
Date: Fri Dec 15 07:48:28 2006
New Revision: 487583

URL: http://svn.apache.org/viewvc?view=rev&rev=487583
Log:
Add "with ESMTP" to received header if EHLO is used. See JAMES-743

Modified:
    james/server/trunk/src/java/org/apache/james/smtpserver/core/DataCmdHandler.java

Modified: james/server/trunk/src/java/org/apache/james/smtpserver/core/DataCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/smtpserver/core/DataCmdHandler.java?view=diff&rev=487583&r1=487582&r2=487583
==============================================================================
--- james/server/trunk/src/java/org/apache/james/smtpserver/core/DataCmdHandler.java (original)
+++ james/server/trunk/src/java/org/apache/james/smtpserver/core/DataCmdHandler.java Fri Dec
15 07:48:28 2006
@@ -208,6 +208,9 @@
         // We will rebuild the header object to put our Received header at the top
         Enumeration headerLines = headers.getAllHeaderLines();
         MailHeaders newHeaders = new MailHeaders();
+        
+        String heloMode = (String) session.getConnectionState().get(SMTPSession.CURRENT_HELO_MODE);
+        
         // Put our Received header first
         headerLineBuffer.append(RFC2822Headers.RECEIVED + ": from ")
                         .append(session.getRemoteHost())
@@ -222,7 +225,16 @@
                         .append(session.getConfigurationData().getHelloName())
                         .append(" (")
                         .append(SOFTWARE_TYPE)
-                        .append(") with SMTP ID ")
+                        .append(") with ");
+     
+        // Check if EHLO was used 
+        if ("EHLO".equals(heloMode)) {
+            headerLineBuffer.append("ESMTP");
+        } else {
+            headerLineBuffer.append("SMTP");
+        }
+        
+        headerLineBuffer.append(" ID ")
                         .append(session.getSessionID());
 
         if (((Collection) session.getState().get(SMTPSession.RCPT_LIST)).size() == 1) {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message