commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@blueyonder.co.uk>
Subject Re: [email] Commons-Email -- not J2EE 1.3?
Date Tue, 06 Sep 2005 22:54:16 GMT
In JavaMail 1.2 you had no choice over how "strict" in checking the RFC822
syntax of an email address was - whether you used the static parse() method
or the InternetAddress constructor to create a new InternetAddress object.

In JavaMail 1.3 flavours of the parse() method and InternetAddress
constructor were added with a "strict" flag so that there was the option of
creating InternetAddress without strictly enforcing RFC822 syntax - the
reason being, in their words "To better support the range of "invalid"
addresses seen in real messages".

Commons Email is however not constructing InternetAddress with an argument
of strict=false and therefore I believe the use of the validate() method is
completley spurious - since its going to throw any AddressExceptions when
the InternetAddress objects are constucted. I believe you could just remove
the line calling the validate() method in the Email.createInternetAddress()
method with no difference in behaviour.

One other point - there don't appear to be any tests of invalid email
addresses in TestEmail. If there were, it would be easy to verify this.

Niall

----- Original Message ----- 
From: "Stephen Colebourne" <scolebourne@btopenworld.com>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>


> Asleson, Ryan wrote:
> > Hello,
> >
> > I just tried using Commons-Email RC5 on WebLogic 8.1. When using the
Email.addTo method, I receive a NoSuchMethodError.
> >
> > It appears that the Email class is attempting to use
InternetAddress.validate(), which is part of J2EE 1.4, not 1.3.  Since I'm
using WebLogic 8.1, which is only J2EE 1.3, it looks like I'm stuck.
> >
> > Is there any way around this?
>
> This sounds like something that should be fixed. Not sure what the
> alternative to this method is though...
>
> Stephen



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


Mime
View raw message