Re: javamail InternetAddress parsing.
2006/1/4, Rick McGuire [EMAIL PROTECTED]: So, what should I target here? Compatibility with the Sun version, or conformance to the RFC822 specification? Hi, I think we should stick to RFC822, which is the only definitive source of information on how JavaMail should work. Besides, Sun's JavaMail specification may contain bugs. Before rendering any judgement, I'd be glad to hear other opinions, too. Rick Jacek
Re: javamail InternetAddress parsing.
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 :[EMAIL PROTECTED]; and :[EMAIL PROTECTED], [EMAIL PROTECTED]; 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 :[EMAIL PROTECTED]; is not a valid group, but group:[EMAIL PROTECTED]' is. The Geronimo versions appears to be incorrect, both in the implementation and the unit test. However, according the Sun version is parsing :[EMAIL PROTECTED]; 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? Nice work. My preference would be RFC822. However, I do wonder how many people might get bitten by this - that are depending on the broken behavior. Sun's JavaMail has been around for quite a while. Maybe a org.apache.geronimo.be.broken.like.sun property to allow people that do depend on it to turn it on? :) geir Rick
Re: javamail InternetAddress parsing.
Jacek Laskowski wrote: 2006/1/4, Geir Magnusson Jr [EMAIL PROTECTED]: Nice work. My preference would be RFC822. However, I do wonder how many people might get bitten by this - that are depending on the broken behavior. Sun's JavaMail has been around for quite a while. Maybe a org.apache.geronimo.be.broken.like.sun property to allow people that do depend on it to turn it on? Seriously, that /might/ be helpful, e.g. while migrating apps to Geronimo. geir Jacek Well, it might be easy to do that, since these are just error paths anyway. I think I'll write my code now for strict conformance and handle a buggy.behavior property later.
Re: javamail InternetAddress parsing.
Jacek Laskowski wrote: 2006/1/4, Geir Magnusson Jr [EMAIL PROTECTED]: Nice work. My preference would be RFC822. However, I do wonder how many people might get bitten by this - that are depending on the broken behavior. Sun's JavaMail has been around for quite a while. Maybe a org.apache.geronimo.be.broken.like.sun property to allow people that do depend on it to turn it on? Seriously, that /might/ be helpful, e.g. while migrating apps to Geronimo. I was dead serious :) Right now, it appears that we have more people working on JavaMail implementation than Sun does. Granted, theirs is complete, but still. This is an area where it would be nice to see an OSS community working, and it's darn useful software as well. *If* Sun's bug is something people depend on, then we wouldn't want to make our software unusable by them - we'd also be letting them know their apps aren't RFC compliant, and they'd have the option to fix at their choosing. geir
Re: javamail InternetAddress parsing.
I came across the same problem when trying to implement POP3 version of the Message. For now I relied on the Sun impl of the MimeMessage and it did have problems of parsing the headers properly especially the InternetAddress. So is Rick going to work on this and have our own MimeMessage impl ??? If so then I can simply extend and do the POP3 stuff with it. But I am willing to help to since it's just not nice to sit back and let Rick do the dirty work. So Rick if you can tell me when I can chip in then we can finish it quickly and then I can finish with the POP3 as well. Regards, Rajith Attapattu. On 1/4/06, Geir Magnusson Jr [EMAIL PROTECTED] wrote: Jacek Laskowski wrote: 2006/1/4, Geir Magnusson Jr [EMAIL PROTECTED] :Nice work.My preference would be RFC822.However, I do wonder howmany people might get bitten by this - that are depending on the brokenbehavior.Sun's JavaMail has been around for quite a while.Maybe a org.apache.geronimo.be.broken.like.sun property to allow people thatdo depend on it to turn it on? Seriously, that /might/ be helpful, e.g. while migrating apps to Geronimo. I was dead serious :)Right now, it appears that we have more people working on JavaMailimplementation than Sun does.Granted, theirs is complete, but still.This is an area where it would be nice to see an OSS community working, and it's darn useful software as well.*If* Sun's bug is something people depend on, then we wouldn't want tomake our software unusable by them - we'd also be letting them knowtheir apps aren't RFC compliant, and they'd have the option to fix at their choosing.geir
Re: javamail InternetAddress parsing.
Rajith Attapattu wrote: I came across the same problem when trying to implement POP3 version of the Message. For now I relied on the Sun impl of the MimeMessage and it did have problems of parsing the headers properly especially the InternetAddress. So is Rick going to work on this and have our own MimeMessage impl ??? We're going to be relying on our own implementation of all of the javamail classes. Unfortunately, as I discovered, the Geronimo version is not complete yet. I'm working on completing the implementation of InternetAddress, plus some changes in Transport. If you know what needs to be fixed in MimeMessage, you ahead and begin work on that. If so then I can simply extend and do the POP3 stuff with it. But I am willing to help to since it's just not nice to sit back and let Rick do the dirty work. So Rick if you can tell me when I can chip in then we can finish it quickly and then I can finish with the POP3 as well. Regards, Rajith Attapattu. On 1/4/06, *Geir Magnusson Jr* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Jacek Laskowski wrote: 2006/1/4, Geir Magnusson Jr [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Nice work. My preference would be RFC822. However, I do wonder how many people might get bitten by this - that are depending on the broken behavior. Sun's JavaMail has been around for quite a while. Maybe a org.apache.geronimo.be.broken.like.sun property to allow people that do depend on it to turn it on? Seriously, that /might/ be helpful, e.g. while migrating apps to Geronimo. I was dead serious :) Right now, it appears that we have more people working on JavaMail implementation than Sun does. Granted, theirs is complete, but still. This is an area where it would be nice to see an OSS community working, and it's darn useful software as well. *If* Sun's bug is something people depend on, then we wouldn't want to make our software unusable by them - we'd also be letting them know their apps aren't RFC compliant, and they'd have the option to fix at their choosing. geir
Re: javamail InternetAddress parsing.
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 :[EMAIL PROTECTED]; and :[EMAIL PROTECTED], [EMAIL PROTECTED]; 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 :[EMAIL PROTECTED]; is not a valid group, but group:[EMAIL PROTECTED]' is. The Geronimo versions appears to be incorrect, both in the implementation and the unit test. However, according the Sun version is parsing :[EMAIL PROTECTED]; 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
Re: javamail InternetAddress parsing.
On 1/4/06, Geir Magnusson Jr [EMAIL PROTECTED] wrote: Nice work. My preference would be RFC822. However, I do wonder how many people might get bitten by this - that are depending on the broken behavior. Sun's JavaMail has been around for quite a while. Maybe a org.apache.geronimo.be.broken.like.sun property to allow people that do depend on it to turn it on? Exactly what I was going to suggest. Make sure that the spec APIs reflect the spec and make the implementation cover the bugginess of Sun's impl. Bruce -- perl -e 'print unpack(u30,D0G)[EMAIL PROTECTED]5R\F)R=6-E+G-N61ED\!G;6%I;\YC;VT* );' Apache Geronimo (http://geronimo.apache.org/)