geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: javamail InternetAddress parsing.
Date Wed, 04 Jan 2006 17:32:05 GMT
I'd prefer RFC822 compliance.  I have no way to judge whether a  
compatibility mode for sun's implementation would be needed but would  
prefer  not to complicate our code with it if at all possible.

thanks
david jencks

On Jan 4, 2006, at 4:07 AM, Rick McGuire wrote:

> I'm trying to write a fuller implementation of the  
> InternetAddress.parseHeader() method for the Geronimo javamail  
> implementation.  I've been writing some tests to see how the Sun  
> javamail implementation is handling various addresses, and then  
> rolling these tests into the Geronimo junit tests for InternetAddress.
> While doing this, I ran the existing junit tests against the Sun  
> javamail package and discovered that the Sun version failed some of  
> the Geronimo unit tests!  Specifically, any of the group address  
> tests in InternetAddressTest where the group did not contain a  
> leading phrase did not get recognized as a group address.  Thus the  
> tests for ":user@host;" and ":user@host, user2@host;" failed when  
> run against the Sun javamail version.
>
> It would be fairly simple to fix the Geronimo version to match the  
> Sun results and fix the tests as well, but I'm not convinced that  
> either version is handling this correctly.  RFC822 specifies that  
> the tag phrase before the ":" in an address is required.  So  
> ":user@host;" is not a valid group, but "group:user@host'" is.  The  
> Geronimo versions appears to be incorrect, both in the  
> implementation and the unit test.
> However, according the Sun version is parsing ":user@host;" as  
> being a simple internet address, retaining both the ":" and ";" as  
> part of the address.  Strict conformance to RFC822 would consider  
> this to be an error rather than a simple address, and I don't  
> believe most mail servers would accept that syntax.
> So, what should I target here?  Compatibility with the Sun version,  
> or conformance to the RFC822 specification?
>
> Rick


Mime
View raw message