james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r179698 - /james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.java
Date Fri, 03 Jun 2005 02:23:02 GMT
Author: noel
Date: Thu Jun  2 19:23:01 2005
New Revision: 179698

URL: http://svn.apache.org/viewcvs?rev=179698&view=rev
Log:
multiple block list support (my current list) and info messages to track effect

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

Modified: james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.java?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.java (original)
+++ james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.java Thu Jun  2 19:23:01
2005
@@ -327,6 +327,8 @@
      * authenticated.
      */
 
+    static final String[] rblList = {"sbl-xbl.spamhaus.org", "list.dsbl.org", "dul.dnsbl.sorbs.net",
"relays.ordb.org"};
+
     private boolean checkDNSRBL(Socket conn) {
         String ip = conn.getInetAddress().getHostAddress();
         StringBuffer sb = new StringBuffer();
@@ -335,20 +337,22 @@
             sb.insert(0, st.nextToken() + ".");
         }
         String reversedOctets = sb.toString();
-        try {
+
+        for (int i = 0 ; i < rblList.length ; i++) try {
             // hardcode which DNS RBL for the moment
-            org.apache.james.dnsserver.DNSServer.getByName(reversedOctets + "sbl-xbl.spamhaus.org");
+            org.apache.james.dnsserver.DNSServer.getByName(reversedOctets + rblList[i]);
+            if (getLogger().isInfoEnabled()) {
+                getLogger().info("Connection from " + ip + " restricted by " + rblList[i]
+ " to SMTP AUTH/postmaster/abuse.");
+            }
             return true;
         } catch (java.net.UnknownHostException uhe) {
             // if it is unknown, it isn't blocked
         }
-        try {
-            // hardcode which DNS RBL for the moment
-            org.apache.james.dnsserver.DNSServer.getByName(reversedOctets + "dul.dnsbl.sorbs.net");
-            return true;
-        } catch (java.net.UnknownHostException uhe) {
-            // if it is unknown, it isn't blocked
+
+        if (getLogger().isInfoEnabled()) {
+            getLogger().info("Connection from " + ip + " not restricted by blocklist.");
         }
+
         return false;
     }
 



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