james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r491608 - in /james/server/sandbox/handlerapi-experiment: TODO src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java src/test/org/apache/james/smtpserver/SMTPServerTest.java
Date Mon, 01 Jan 2007 18:28:00 GMT
Author: norman
Date: Mon Jan  1 10:27:59 2007
New Revision: 491608

URL: http://svn.apache.org/viewvc?view=rev&rev=491608
Log:
Correct the RBL SMTP Return code to 554

Modified:
    james/server/sandbox/handlerapi-experiment/TODO
    james/server/sandbox/handlerapi-experiment/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
    james/server/sandbox/handlerapi-experiment/src/test/org/apache/james/smtpserver/SMTPServerTest.java

Modified: james/server/sandbox/handlerapi-experiment/TODO
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi-experiment/TODO?view=diff&rev=491608&r1=491607&r2=491608
==============================================================================
--- james/server/sandbox/handlerapi-experiment/TODO (original)
+++ james/server/sandbox/handlerapi-experiment/TODO Mon Jan  1 10:27:59 2007
@@ -5,7 +5,6 @@
 - on Rcpt message reject, the original code was logging a lot of informations. Maybe we should
change the Hook callers to do something similar (in RcptCmdHandler create a log string including
context() call)
 - Check AuthRequiredToRelayRcptHook to see if it is correct to return different SMTP codes
if Auth is announced (for relaying denied)
 - Remove CURRENT_RECIPIENT key from state usage: I think we don't use it anymore but in tests.
-- Check why testDNSRBLRehectWorks was expecting 550, while we return now 554 (or maybe we
should return 530, but not 550).
 - RcptOptions: introduce a new extension points to have Handlers to declare support for given
command options so that the syntax check can support them.
   - maybe also add to Mail and Rcpt standard hooks an options map parameter (MAIL's SIZE,
RCPT's ORCPT/NOTIFY keyworks)
   - or maybe another non public api hook to be implemented by smtp extensions.

Modified: james/server/sandbox/handlerapi-experiment/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi-experiment/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java?view=diff&rev=491608&r1=491607&r2=491608
==============================================================================
--- james/server/sandbox/handlerapi-experiment/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
(original)
+++ james/server/sandbox/handlerapi-experiment/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
Mon Jan  1 10:27:59 2007
@@ -34,7 +34,6 @@
 import org.apache.james.smtpserver.hook.HookResult;
 import org.apache.james.smtpserver.hook.HookReturnCode;
 import org.apache.james.smtpserver.hook.RcptHook;
-import org.apache.james.util.mail.SMTPRetCode;
 import org.apache.james.util.mail.dsn.DSNStatus;
 import org.apache.mailet.MailAddress;
 
@@ -255,11 +254,11 @@
                 !(session.isAuthRequired() && session.getUser() != null) // Not (SMTP
AUTH is enabled and not authenticated)
                 ) {
             if (blocklistedDetail == null) {
-                return new HookResult(HookReturnCode.DENY,SMTPRetCode.AUTH_REQUIRED,DSNStatus.getStatus(DSNStatus.PERMANENT,
+                return new HookResult(HookReturnCode.DENY,DSNStatus.getStatus(DSNStatus.PERMANENT,
                         DSNStatus.SECURITY_AUTH)  + " Rejected: unauthenticated e-mail from
" + session.getRemoteIPAddress() 
                         + " is restricted.  Contact the postmaster for details.");
             } else {
-                return new HookResult(HookReturnCode.DENY,SMTPRetCode.AUTH_REQUIRED,DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.SECURITY_AUTH)
+ " " + blocklistedDetail);
+                return new HookResult(HookReturnCode.DENY,DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.SECURITY_AUTH)
+ " " + blocklistedDetail);
             }
            
         }

Modified: james/server/sandbox/handlerapi-experiment/src/test/org/apache/james/smtpserver/SMTPServerTest.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi-experiment/src/test/org/apache/james/smtpserver/SMTPServerTest.java?view=diff&rev=491608&r1=491607&r2=491608
==============================================================================
--- james/server/sandbox/handlerapi-experiment/src/test/org/apache/james/smtpserver/SMTPServerTest.java
(original)
+++ james/server/sandbox/handlerapi-experiment/src/test/org/apache/james/smtpserver/SMTPServerTest.java
Mon Jan  1 10:27:59 2007
@@ -1465,7 +1465,7 @@
         smtpProtocol.setSender(sender);
 
         smtpProtocol.addRecipient("mail@sample.com");
-        assertEquals("reject: "+smtpProtocol.getReplyString(), 550, smtpProtocol
+        assertEquals("reject: "+smtpProtocol.getReplyString(), 554, smtpProtocol
                 .getReplyCode());
 
         smtpProtocol.sendShortMessageData("Subject: test\r\n\r\nTest body testDNSRBLRejectWorks\r\n");



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