danny       01/11/29 05:40:25

  Modified:    src/java/org/apache/james/smtpserver SMTPHandler.java
  Log:
  altered command parsing to fix bug 5165 which was preventing quoted strings 
containing spaces being used for local-part of FROM: and TO:
  
  Revision  Changes    Path
  1.10      +13 -18    
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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SMTPHandler.java  2001/11/26 03:27:55     1.9
  +++ SMTPHandler.java  2001/11/29 13:40:25     1.10
  @@ -42,9 +42,10 @@
    * @author Federico Barbieri <[EMAIL PROTECTED]>
    * @author Jason Borden <[EMAIL PROTECTED]>
    * @author Matthew Pangaro <[EMAIL PROTECTED]>
  + * @author Danny Angus <[EMAIL PROTECTED]>
    *
  - * This is $Revision: 1.9 $
  - * Committed on $Date: 2001/11/26 03:27:55 $ by: $Author: serge $
  + * This is $Revision: 1.10 $
  + * Committed on $Date: 2001/11/29 13:40:25 $ by: $Author: danny $
    */
   public class SMTPHandler
       extends BaseConnectionHandler
  @@ -207,26 +208,20 @@
   
       private boolean parseCommand(String command)
           throws Exception {
  -
  +        String argument  = null;
  +        String argument1 = null;
           if (command == null) return false;
           if (state.get(MESG_FAILED) == null) {
               getLogger().info("Command received: " + command);
  +        }
  +        command = command.trim();
  +        if (command.indexOf(" ")>0){
  +            argument = command.substring(command.indexOf(" ")+1);
  +            command = command.substring(0,command.indexOf(" "));
  +            if(argument.indexOf(":")>0){
  +                argument1 = argument.substring(argument.indexOf(":")+1);
  +                argument = argument.substring(0,argument.indexOf(":"));
           }
  -        StringTokenizer commandLine
  -            = new StringTokenizer(command.trim(), " :");
  -        int arguments = commandLine.countTokens();
  -        if (arguments == 0) {
  -            return true;
  -        } else if(arguments > 0) {
  -            command = commandLine.nextToken();
  -        }
  -        String argument = (String) null;
  -        if(arguments > 1) {
  -            argument = commandLine.nextToken();
  -        }
  -        String argument1 = (String) null;
  -        if(arguments > 2) {
  -            argument1 = commandLine.nextToken();
           }
   
           if (command.equalsIgnoreCase("HELO"))
  
  
  

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

Reply via email to