Ok,
Here's a new version of the patch I just sent, which should be a bit cleaner. The diff is now just to patch MailAddress. The original change is still there, but now it's changed the getHost() method to return the ip address without the [] chars, in the case of a dotNum host. It seemed like this was better, since it should avoid having to patch any other classes. I don't think there are any other classes where the MailAddress is being deconstructed and reconstructed. That's the only thing this would affect, since the new email address string would lack the braces.
 
Matt Pangaro
 
p.s. Sorry for the extraneous traffic.
p.p.s. the "objectionable" content in the diff and the original message have been cleansed to protect the innocent and the pure of heart... ;-)
----- Original Message -----
Sent: Friday, September 28, 2001 5:45 PM
Subject: Small Patch

Hi all,
Was looking in Bugzilla to see if there was anything I could take a stab at. Attached is a diff for bug 2006. This should get MailAddress to accept localpart@[yyy.yyy.yyy.yyy] addresses.
 
diff.txt patches MailAddress to make it properly parse out the dotNum host part. diff2.txt is a patch to RemoteDelivery to have it strip the [] chars from the host before doing getMailServers, so the lookup works.
 
If the fixes are acceptable, I'm not sure what the protocol is, but the bug could be closed in bugzilla.
 
Have done some local testing, and will keep hacking at it to see if there are any other parts choking on the [yyy.yyy.yyy.yyy] host parts.
 
Index: MailAddress.java
===================================================================
RCS file: /home/cvspublic/jakarta-james/src/java/org/apache/mailet/MailAddress.java,v
retrieving revision 1.2
diff -r1.2 MailAddress.java
156,157c156,157
<      *          of this email address.
<      * @throws  AddressException    if the parse failed
---
>      *          of this email address. If the host is of the dotNum form
>      *          (e.g. [yyy.yyy.yyy.yyy]) then strip the braces first.
160c160,164
<         return host;
---
>         if (!(host.startsWith("[") && host.endsWith("]"))) {
>             return host;
>         } else {
>             return host.substring(1, host.length() -1);
>         }
327a332,336
>         //we were passed the string with pos pointing the the [ char.
>         // take the first char ([), put it in the result buffer and increment pos
>         resultSB.append(address.charAt(pos));
>         pos++;
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to