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 Marcello Marangio <m....@tno.it> on 2003/09/04 10:42:24 UTC

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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


RE: how to share between incoming msgs and outgoing msgs

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
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:m.marangio@tno.it]
> 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:vincenzo.gianferraripini@praxis.it]
> > 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:m.marangio@tno.it]
> > > 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: server-dev-unsubscribe@james.apache.org
> > > For additional commands, e-mail: server-dev-help@james.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-dev-help@james.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 


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


R: how to share between incoming msgs and outgoing msgs

Posted by Marcello Marangio <m....@tno.it>.
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:vincenzo.gianferraripini@praxis.it]
> 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:m.marangio@tno.it]
> > 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: server-dev-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-dev-help@james.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>


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


RE: how to share between incoming msgs and outgoing msgs

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
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:m.marangio@tno.it]
> 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: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 


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