You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2003/05/19 19:47:55 UTC

RE: Redirect - Special MailAddresses

>>>   b) The new private variable "returnPath" is defined as String instead
>>>      of MailAddress in order to hold also the special value "" in case
>>>      <returnPath>empty</returnPath> is set.

>> Well, I prefer consistancy, but I see your point.  Does it make sense to
>> modify MailAddress to support the special "<>" empty address?

> I was thinking on modifying MailAddress to support generic "virtual" (or
> "magic" in the Redirect terminology) addresses, like EMPTY, SENDER,
> POSTMASTER

Seems reasonable at first glance.  But we cannot have "postmaster",
"sender", or whatever be recognized as a magic value in terms of
MailAddress.  That would step on valid localpart values.  However, we could
use class members, e.g.,

  public class MailAddress {
      public final static MailAddress NULL         = ...
	public final static MailAddress POSTMASTER   = ...
  }

> For the moment I'm using things like "", null, empty collections to handle
> those needs when they arise, and the meanings are "context sensitive",
> which is not super.

Not super indeed.  :-)  They tend to end up becoming "undocumented
semantics", and very hard to maintain.

> A modified MailAddress (or subclass) implementing such "magic" values
> could also handle some very dynamic situations in which the callback
> methods in Redirect need to access the Mail object, as for example
> getSender(), getRecipients(), getMessage().

> As this functionality could be useful in general (not only for Redirect
and his children),
> it should be carefully thought before implementing

I concur.  Hence my thought that we "experiment" with it in isolation.  But
if it helps to clean up Redirect and the various addressing options, that
would be a very good thing.

Perhaps we could extend the idea of static MailAddress instances, e.g.,

public class Redirect extends extends GenericMailet {
      public final static MailAddress SENDER       = ...
      public final static MailAddress TO           = ...
      public final static MailAddress RECIPIENTS   = ...
      public final static MailAddress DELETE       = ...
      public final static MailAddress UNALTERED    = ...
}

Something to mull over.

	--- Noel


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