Changeset 157

Show
Ignore:
Timestamp:
03/05/07 10:17:03 (2 years ago)
Author:
jfp
Message:

@ parse fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jsmtpd/src/org/jsmtpd/core/mail/EmailAddress.java

    r136 r157  
    5757            mailPart=res[0].trim(); 
    5858        } else 
    59             mailPart=input.trim(); 
     59            mailPart=input.trim();      
    6060         
    61         if (mailPart.indexOf('@') == -1) 
    62             throw new InvalidAddress(); 
     61        if (!mailPart.matches("^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*$")) 
     62                throw new InvalidAddress(); 
     63         
    6364        String[] res = mailPart.split("@"); 
    6465 
     66      
     67         
    6568        if ((res[0].length() > 512) || (res[1].length() > 512)) 
    6669            throw new InvalidAddress();