commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36536] New: - [Email] Compatability With JavaMail 1.2
Date Wed, 07 Sep 2005 03:53:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36536>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36536

           Summary: [Email] Compatability With JavaMail 1.2
           Product: Commons
           Version: Nightly Builds
          Platform: Other
               URL: http://java.sun.com/products/javamail/JavaMail-1.3-
                    changes.txt
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Email
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: niallp@apache.org


The InternetAddress.validate() method is the only version 1.3 feature of 
JavaMail used in commons-email. Removing its use means that commons-email will 
compile (and tests run) against JavaMail 1.2

This ticket is as a result of this thread on the user list:

http://www.mail-archive.com/commons-user%40jakarta.apache.org/msg12817.html

However some of the assertions I made there were incorrect.

JavaMail 1.3 introduced the facility to specify a strict=false setting when 
parsing an InternetAddress and a new validate() method to check whether 
a "loosley parsed" InternetAddress was valid.

I made a mistake in that thread. The Email class uses the following 
constructors:

 InternetAdress(String address, String personal)
 InternetAdress(String address, String personal, String charset)

These constructors assume the "address" is a valid RFC822 internet address and 
don't "validate" them. Therefore Email as its currently coded is correct to 
then call the validate() method.

However the following constructor does validate...

 InternetAdress(String address)

... and I'm attaching a patch which removes the need to use the validate() 
method.

However its not quite that simple. Since the validate() method in JavaMail 1.3 
isn't "as strict" as the above constructor - which is compatible with JavaMail 
1.2 - it doesn't validate addresses which contain quotes or '[' at all. 
Therefore applying the patch will make it 1.2 compatible, but also make the 
validation stricter.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message