pgoldstein    2002/10/01 23:57:56

  Modified:    src/java/org/apache/james/smtpserver SMTPHandler.java
  Log:
  Fix for parity bug in SMTP MAIL SIZE handling.
  Added host, ip to all connection debug messages
  
  Revision  Changes    Path
  1.30      +20 -10    
jakarta-james/src/java/org/apache/james/smtpserver/SMTPHandler.java
  
  Index: SMTPHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/smtpserver/SMTPHandler.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- SMTPHandler.java  2 Oct 2002 06:12:03 -0000       1.29
  +++ SMTPHandler.java  2 Oct 2002 06:57:56 -0000       1.30
  @@ -349,7 +349,9 @@
                       new StringBuffer(64)
                           .append("Socket to ")
                           .append(remoteHost)
  -                        .append(" closed remotely.");
  +                        .append(" (")
  +                        .append(remoteIP)
  +                        .append(") closed remotely.");
                   getLogger().debug(errorBuffer.toString(), se );
               }
           } catch ( InterruptedIOException iioe ) {
  @@ -358,7 +360,9 @@
                       new StringBuffer(64)
                           .append("Socket to ")
                           .append(remoteHost)
  -                        .append(" timeout.");
  +                        .append(" (")
  +                        .append(remoteIP)
  +                        .append(") timeout.");
                   getLogger().debug( errorBuffer.toString(), iioe );
               }
           } catch ( IOException ioe ) {
  @@ -367,7 +371,9 @@
                       new StringBuffer(256)
                               .append("Exception handling socket to ")
                               .append(remoteHost)
  -                            .append(":")
  +                            .append(" (")
  +                            .append(remoteIP)
  +                            .append(") : ")
                               .append(ioe.getMessage());
                   getLogger().debug( errorBuffer.toString(), ioe );
               }
  @@ -398,7 +404,7 @@
        * TODO: Remove this interface from the class and change the mechanism
        */
       public void targetTriggered(final String triggerName) {
  -        getLogger().error("Connection timeout on socket");
  +        getLogger().error("Connection timeout on socket with " + remoteHost + " (" 
+ remoteIP + ")");
           try {
               out.println("Connection timeout. Closing connection");
               socket.close();
  @@ -916,7 +922,7 @@
               String responseString = "501 Syntactically incorrect value for SIZE 
parameter";
               writeLoggedFlushedResponse(responseString);
               getLogger().error("Rejected syntactically incorrect value for SIZE 
parameter.");
  -            return true;
  +            return false;
           }
           if (getLogger().isDebugEnabled()) {
               StringBuffer debugBuffer = 
  @@ -936,19 +942,21 @@
                       .append(state.get(SENDER).toString())
                       .append(" from host ")
                       .append(remoteHost)
  -                    .append(" of size ")
  +                    .append(" (")
  +                    .append(remoteIP)
  +                    .append(") of size ")
                       .append(size)
                       .append(" exceeding system maximum message size of ")
                       .append(maxmessagesize)
                       .append("based on SIZE option.");
               getLogger().error(errorBuffer.toString());
  -            return true;
  +            return false;
           } else {
               // put the message size in the message state so it can be used
               // later to restrict messages for user quotas, etc.
               state.put(MESG_SIZE, new Integer(size));
           }
  -        return false;
  +        return true;
       }
   
   
  @@ -1279,7 +1287,9 @@
                               .append(state.get(SENDER).toString())
                               .append(" from host ")
                               .append(remoteHost)
  -                            .append(" exceeding system maximum message size of ")
  +                            .append(" (")
  +                            .append(remoteIP)
  +                            .append(") exceeding system maximum message size of ")
                               .append(maxmessagesize);
                       getLogger().error(errorBuffer.toString());
                   } else {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to