----- Original Message -----
From: "Serge Knystautas" <[EMAIL PROTECTED]>
To: "Java Apache Mail Server" <[EMAIL PROTECTED]>
Sent: Sunday, September 03, 2000 3:10 AM
Subject: Re: New mailet API proposed
> Serge Knystautas wrote:
> > It's not a question of throwing away the personal field... we never get
> > it!
> >
> > I think it would be better to strip all static methods (and drop the
> > personal field since we never get it) and just leave this as a simple
> > class with the following method signature:
> >
> > public MailAddress(String address);
> > public MailAddress(String user, String host);
> > public String getUser();
> > public String getHost();
> > public String toString(); file://overriden
> > public String equals(Object obj); file://overriden
> >
> > This keeps the class easy to use and still relates user and host, with
> > the single String constructor to make it easy to convert to and from
> > String.
>
> I wanted to clarify where MailAddress would be used as it helps define
> what why we need it and what it needs to do. A MailAddress is an
> address specified in the MAIL FROM and RCPT TO commands in SMTP
> sessions. These are either passed by an external server to the
> mailet-compliant SMTP server, or they are created programmatically by
> the mailet-compliant server to send to another (external) SMTP server.
> Mailets and matchers use the MailAddress for the purpose of evaluating
> the sender and recipient(s) of a message.
>
> With this in mind, I've gone to RFC 821 (SMTP) p. 29 where these
> addresses are defined in BNF convention. I've assumed we're not
> supporting the aged "SMTP-relayed mail" protocol. This leaves all
> addresses should be a <mailbox>, as per the spec. This makes the
> MailAddress "user" the <local-part> of the <mailbox> and "host" the
> <domain> of the mailbox.
>
> I think this class is a good way to validate email addresses, and also,
> there are some valid addresses which would fail with the existing
> approach to parsing address. It also removes parsing burden from
> mailets and matchers that might not realize the flexibility of an SMTP
> address. For instance, "serge@home"@lokitech.com is a valid SMTP
> address (the quoted text serge@home is the user and lokitech.com is the
> host). This means all current parsing to date is incorrect as we just
> find the first @ and use that to separate user from host. I'm writing a
> parser to try to take care of this more robust, and I'm planning to
> throw a java.util.ParseException if there's something wrong with the
> address. This address parsing has the added benefit of making the SMTP
> engine a bit more robust as it can reject misformatted addresses
> immediately.
>
> I was actually relaxing some this weekend but still plan to commit
> changes this long labor day weekend. I'll publish new javadocs once I
> have Roberto's MailAddress reworked to handle the more robust parsing
> and to remove the personal address support (as it's not appropriate for
> how we're using MailAddress).
I have a new, little modified, version of the MailAddress: do you prefer to
throw ParseException instead of AddressException ?
Roberto
>
> Serge Knystautas
> Loki Technologies
> http://www.lokitech.com/
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]