You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by se...@apache.org on 2002/05/25 19:16:26 UTC

cvs commit: jakarta-james/src/java/org/apache/james/transport/matchers InSpammerBlacklist.java

serge       02/05/25 10:16:25

  Modified:    src/java/org/apache/james/transport/matchers
                        InSpammerBlacklist.java
  Log:
  Corrected how the IP address was getting reversed and prepended (thanks to Noel)
  
  Revision  Changes    Path
  1.3       +7 -3      jakarta-james/src/java/org/apache/james/transport/matchers/InSpammerBlacklist.java
  
  Index: InSpammerBlacklist.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/InSpammerBlacklist.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InSpammerBlacklist.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ InSpammerBlacklist.java	25 May 2002 17:16:25 -0000	1.3
  @@ -43,14 +43,18 @@
           String host = mail.getRemoteAddr();
           try {
               //Have to reverse the octets first
  +            StringBuffer sb = new StringBuffer();
               StringTokenizer st = new StringTokenizer(host, " .", false);
  -            host = network;
  +
               while (st.hasMoreTokens()) {
  -                host = st.nextToken() + ".";
  +                sb.insert(0, st.nextToken() + ".");
               }
   
  +            //Add the network prefix for this blacklist
  +            sb.append(network);
  +
               //Try to look it up
  -            InetAddress.getByName(host);
  +            InetAddress.getByName(sb.toString());
   
               //If we got here, that's bad... it means the host
               //  was found in the blacklist
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>