Brian,

regarding your point 1, my understanding is that in v3 the MailImpl object will not be 
directly accessible (no casting will be allowed from Mail to MailImpl), and because of 
that only the Mail interface methods will be executable; for now setRecipients(Mail) 
is *not* defined in Mail but only in MailImpl, so, unless the API is changed ...
But as you say the recipients collection got with Mail.getRecipients is modifiable, 
unless (it's not like that now) a copy of the recipients collection is temporarily set 
in the Mail before calling Mailet.service(Mail) and restored afterwards.
But I may be wrong, and surely Serge, Noel or Danny could help us clarifying (or 
pointing to) the intentions behind the V3 Mailet API.

Regarding your point 2, you are totally right, and IMO it totally justifies your 
approach.

Vincenzo

> -----Original Message-----
> From: Brian J. Sayatovic [mailto:[EMAIL PROTECTED]
> Sent: martedi 21 ottobre 2003 0.16
> To: 'James Users List'
> Subject: RE: What to do with my new matcher?
> 
> 
> Well, I had two thoughts on that...
> 
> 1. I heard that the ability to set recipients was going to be removed from
> the public Mailet API in v3.0.  I don't know if this just means the
> "setRecipients(Collection)" method, or if it means the ability to modify
> recipients.  If it is the former, I could still modify the returned
> Collection from "getRecipients():Collection".  If, I'd be screwed.  Either
> way, even my current oslution could be broken.
> 
> 2. I thought, perhaps, that replacing the recipients that need to be
> replaced may result in MailAdrresses that should get a fair run 
> through the
> full MailetChain again (suppose a prior Mailet would've done something had
> the recipient been in place as it is after my WildcardAlias 
> Mailet gets it).
> 
> Regards,
> Brian.
> 
> -----Original Message-----
> From: Vincenzo Gianferrari Pini 
> [mailto:[EMAIL PROTECTED] 
> Sent: Monday, October 20, 2003 8:06 AM
> To: James Users List
> Subject: RE: What to do with my new matcher?
> 
> 
> Brian,
> 
> unless you need to modify the message sent to the "new recipient list" to
> make it different from the one sent to the "original recipient list", you
> can simply manipulate the original mail's recipient list, adding the new
> MailAddress-es and removing the ones you need, and let the 
> original mail go
> on *without* having to create a new Mail and send it through MailetContext
> etc.
> 
> This is the code in LinearProcessor that invokes a mailet:
>                 ...
>                 mailet.service(mail);
>                 // Make sure all the recipients are still MailAddress
> objects
>                 verifyMailAddresses(mail.getRecipients());
>                 ...
> 
> Vincenzo
> 
> > -----Original Message-----
> > From: Brian J. Sayatovic [mailto:[EMAIL PROTECTED]
> > Sent: sabato 18 ottobre 2003 22.19
> > To: 'James Users List'
> > Subject: RE: What to do with my new matcher?
> > 
> > 
> > I've now modified my code.
> > 
> > WildcardAlias is now a Mailet.  It iterates through the recipient 
> > MailAddresses, looking for ones from a host that is local.  If one is 
> > found, the regex is applied, extracting the real user.  A new
> > MailAddress is built
> > and added to a List while the original MailAddress is removed from the
> > Mail's recipients.  Finally, the Mail is sent, via the 
> > MailetContext, to the
> > new recipient list (those that were built from the regex 
> matches) and the
> > original Mail is left to go one (minus the extracted recipients).
> > 
> > It works.  Is it sound?
> > 
> > Regards,
> > Brian.
> > 
> > -----Original Message-----
> > From: Serge Knystautas [mailto:[EMAIL PROTECTED]
> > Sent: Friday, October 17, 2003 9:23 AM
> > To: James Users List
> > Subject: Re: What to do with my new matcher?
> > 
> > 
> > Brian J. Sayatovic wrote:
> > > Well, I'd like to say I understood that, but I'm not sure I did.
> > > 
> > > So given an e-mail addressed to [EMAIL PROTECTED] and [EMAIL PROTECTED], I 
> > > want
> > > my Matcher-or-Mailet to make sure it gets (locally) delivered to 
> > > [EMAIL PROTECTED] and [EMAIL PROTECTED] instead.  I get the impression I should 
> > > be 
> > > using the "All" matcher from another responder to this thread.
> > > 
> > > If that's the case, thenw hat should my Matcher do?
> > > 
> > > 1. Modify the recipients to replace [EMAIL PROTECTED] with [EMAIL PROTECTED] ?
> > > 2. MailetContext.send() the Mail to [EMAIL PROTECTED] 3. Something else?
> > > 
> > > I hate to say it, but I think I need a flow chart and Venn diagrams 
> > > to
> > > understand this.
> > 
> > Brian,
> > 
> > I didn't think this was that hard, but can see how your example is
> > confusing you.  The intention was to have Matcher be a read-only 
> > dissection of the recipient list, and Mailets perform any changes.
> > 
> > To do what you want with the intention, you could have this:
> > 
> > Step A
> > - Matcher A returns [EMAIL PROTECTED]
> > - Mailet A squashes the matching recipient addresses to [EMAIL PROTECTED] and
> > [EMAIL PROTECTED]
> > 
> > Step B
> > - Matcher B returns [EMAIL PROTECTED] or [EMAIL PROTECTED]
> > - Mailet B does whatever processing you want.
> > 
> > OR
> > 
> > Step A
> > - Matcher A returns [EMAIL PROTECTED]
> > - Mailet A does whatever processing you want.
> > 
> > I included the first alternative since it seems you wanted to squash 
> > the
> > address names first, although I'm not sure why.
> > 
> > --
> > Serge Knystautas
> > President
> > Lokitech >> software . strategy . design >> http://www.lokitech.com p.
> > 301.656.5501 e. [EMAIL PROTECTED]
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

Reply via email to