Looking at the RecipientIsLocal matcher, a test to see if the message is incoming
(going to a local user) is the following:
if (mailetContext.isLocalServer(recipient.getHost()) &&
mailetContext.isLocalUser(recipient.getUser())) {
// is local
}
But I think, reading your clarification, that there is a misunderstanding: if the
message comes from a local user, and goes to a (possibly different) local user, it
will be processed *only once*:
client -> james spool -> begin mailet processing -> local delivery (inboxes) ->
client
Only if the message is *forwarded/resent etc.* it would be processed twice (split):
client -> james spool -> begin mailet processing ... forward! ... more mailet
processing -> to ghost or local delivery (inboxes) -> client
|
+-> james spool =>
begin mailet processing => local delivery (inboxes) => client
Vincenzo
> -----Original Message-----
> From: Marcello Marangio [mailto:[EMAIL PROTECTED]
> Sent: giovedi 4 settembre 2003 12.24
> To: James Developers List
> Subject: R: how to share between incoming msgs and outgoing msgs
>
>
> Vincenzo,
> thanks for the answer.
> My scenario is slightly different.
> I can have e-mails msgs sent between two users belonging to the
> same domain,
> and I would like to make my mailet (triggered with the matcher "All", for
> example) process the message twice: the first time when the mailet catches
> the outgoing mail and the second time when the recepients
> actually receives
> it, i.e. just before the mail is forwarded to the recipient. Note: in both
> cases the mailet is the same!
> Is there a standard method to do this?
>
> Grazie
> Marcello
>
>
>
> > -----Messaggio originale-----
> > Da: Vincenzo Gianferrari Pini
> > [mailto:[EMAIL PROTECTED]
> > Inviato: giovedi 4 settembre 2003 11.12
> > A: James Developers List
> > Oggetto: RE: how to share between incoming msgs and outgoing msgs
> >
> >
> > Marcello,
> >
> > Look at the "standard" config.xml logic:
> >
> > ...
> > <!-- If the recipient is for a local account, deliver it
> > locally -->
> > <mailet match="RecipientIsLocal" class="LocalDelivery"/>
> >
> > <!-- If the host is handled by this server and it did
> not get -->
> > <!-- locally delivered, this is an invalid recipient -->
> > <mailet match="HostIsLocal" class="ToProcessor">
> > <processor>local-address-error</processor>
> > <notice>Unknown recipient</notice>
> > </mailet>
> > ...
> >
> > if we are here it is an outgoing message
> >
> > Look at the RecipientIsLocal and HostIsLocal matchers.
> >
> > Ciao,
> > Vincenzo
> >
> > > -----Original Message-----
> > > From: Marcello Marangio [mailto:[EMAIL PROTECTED]
> > > Sent: giovedi 4 settembre 2003 10.42
> > > To: James Developers List
> > > Subject: how to share between incoming msgs and outgoing msgs
> > >
> > >
> > > Hi all
> > > I have a newbie problem: how can I make a mailet (or a matcher)
> > understand
> > > that a message is an outgoing rather than an incoming message?
> > > I couldn't find anything in the SMTP standard, nor in james docs.
> > > Can anybody please help me?
> > >
> > > Thanks
> > > Marcello
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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]