james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r365626 - /james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java
Date Tue, 03 Jan 2006 13:23:12 GMT
Author: bago
Date: Tue Jan  3 05:23:08 2006
New Revision: 365626

URL: http://svn.apache.org/viewcvs?rev=365626&view=rev
Log:
Exceeding maximum value with MAIL SIZE caused NullPointerException (JAMES-286)

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

Modified: james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java?rev=365626&r1=365625&r2=365626&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java (original)
+++ james/server/trunk/src/java/org/apache/james/smtpserver/MailCmdHandler.java Tue Jan  3
05:23:08 2006
@@ -96,7 +96,7 @@
                     // Handle the SIZE extension keyword
 
                     if (mailOptionName.startsWith(MAIL_OPTION_SIZE)) {
-                        if (!(doMailSize(session, mailOptionValue))) {
+                        if (!(doMailSize(session, mailOptionValue, sender))) {
                             return;
                         }
                     } else {
@@ -166,9 +166,10 @@
      *
      * @param session SMTP session object
      * @param mailOptionValue the option string passed in with the SIZE option
+     * @param tempSender the sender specified in this mail command (for logging purpose)
      * @return true if further options should be processed, false otherwise
      */
-    private boolean doMailSize(SMTPSession session, String mailOptionValue) {
+    private boolean doMailSize(SMTPSession session, String mailOptionValue, String tempSender)
{
         int size = 0;
         try {
             size = Integer.parseInt(mailOptionValue);
@@ -195,7 +196,7 @@
             StringBuffer errorBuffer =
                 new StringBuffer(256)
                     .append("Rejected message from ")
-                    .append(session.getState().get(SENDER).toString())
+                    .append(tempSender != null ? tempSender.toString() : null)
                     .append(" from host ")
                     .append(session.getRemoteHost())
                     .append(" (")



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