You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Neill Robbins <ne...@phocis.com> on 2003/11/26 19:28:24 UTC

Mail.setRecipients - So I might have bothered you enough, but... :-)

I think I am almost there... :-)

My problem at the moment is that I want to change the recipients on the
Mail in my Mailet.

Unfortunately Mail.setRecipients doesn't seem to exist, even though the
implementation exists in MailImpl.

Is there a good reason for this, or was it an oversight?  

I have downloaded the 2.1.3 source, added setRecipients to the Mail
interface, and built a binary.  I have tested the binary works as
expected, and it appears to be OK.

Again, am I missing some reason why setRecipients was not included
that's gonna come bite my ass...

Thanks in advance...

N

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


Re: Mail.setRecipients - So I might have bothered you enough, but... :-)

Posted by Serge Knystautas <se...@lokitech.com>.
Neill Robbins wrote:
> I think I am almost there... :-)
> 
> My problem at the moment is that I want to change the recipients on the
> Mail in my Mailet.
> 
> Unfortunately Mail.setRecipients doesn't seem to exist, even though the
> implementation exists in MailImpl.
> 
> Is there a good reason for this, or was it an oversight?  

Mailets shouldn't be doing a whole-sale changing of recipients implied 
by using setRecipients().

Instead, get the Collection from getRecipients(), and add/remove/modify 
the MailAddress objects in that Collection.  That's all it takes.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


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


RE: Mail.setRecipients - So I might have bothered you enough, but... :-)

Posted by Gili <ju...@bbs.darktech.org>.
	Noel, I actually agree with Neill. I understand that mail.getRecipients() and modifying it works, but it is 
not intuitive and does not follow the Javabeans approach. Why not add setReceipients()? There isn't really an 
overhead there; you're just changing the reference of your collection from the old collection to the new one (and 
frankly, this also allows you to reuse the same collection). Sun's code does this across their entire API; we 
should do the same.

Gili

On Wed, 26 Nov 2003 13:45:34 -0500, Noel J. Bergman wrote:

>> My problem at the moment is that I want to change the recipients
>> on the Mail in my Mailet.

>> Unfortunately Mail.setRecipients doesn't seem to exist

>  Collection recipients = mail.getRecipients();

>Just change it.

>	--- Noel

>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org




RE: Mail.setRecipients - So I might have bothered you enough, but... :-)

Posted by "Noel J. Bergman" <no...@devtech.com>.
> My problem at the moment is that I want to change the recipients
> on the Mail in my Mailet.

> Unfortunately Mail.setRecipients doesn't seem to exist

  Collection recipients = mail.getRecipients();

Just change it.

	--- Noel

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