james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1362965 - /james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
Date Wed, 18 Jul 2012 14:31:58 GMT
Author: eric
Date: Wed Jul 18 14:31:58 2012
New Revision: 1362965

URL: http://svn.apache.org/viewvc?rev=1362965&view=rev
Log:
AbstractHookableCmdHandler.calcDefaultSMTPResponse throws exception for lonely DISCONNECT
and incorrect condition for DENYSOFT, contributed by TzeKai Lee (PROTOCOLS-97)

Modified:
    james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java

Modified: james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java?rev=1362965&r1=1362964&r2=1362965&view=diff
==============================================================================
--- james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
(original)
+++ james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
Wed Jul 18 14:31:58 2012
@@ -176,7 +176,7 @@ public abstract class AbstractHookableCm
                     response.setEndSession(true);
                 }
                 return response;
-            } else if (rCode == HookReturnCode.DENYSOFT) {
+            } else if ((rCode & HookReturnCode.DENYSOFT) == HookReturnCode.DENYSOFT)
{
                 if (smtpRetCode == null)
                     smtpRetCode = SMTPRetCode.LOCAL_ERROR;
                 if (smtpDesc == null)
@@ -199,7 +199,12 @@ public abstract class AbstractHookableCm
                 }
                 return response;
             } else if ((rCode & HookReturnCode.DISCONNECT) == HookReturnCode.DISCONNECT)
{
-                SMTPResponse response = new SMTPResponse("");
+                if (smtpRetCode == null)
+                    smtpRetCode = SMTPRetCode.TRANSACTION_FAILED;
+                if (smtpDesc == null)
+                    smtpDesc = "Server disconnected";
+
+                SMTPResponse response =  new SMTPResponse(smtpRetCode, smtpDesc);
                 response.setEndSession(true);
                 return response;
             } else {



---------------------------------------------------------------------
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