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 Hassan Latif <ha...@gmail.com> on 2015/03/18 18:40:50 UTC

Matcher/Mailet clauses order of execution

Hello,

I'm struggling to find some text on this. Is there any specific order of
execution for the matcher/mailet clauses that are declared in
mailetcontainer.conf. Let's say we want to first check whether the Sender
is known (e.g. by using SenderIs matcher) and then check whether the sender
is from a specific host (using SenderHostIs matcher), is there a way to
enforce this order of execution?

Appreciate your help.

-Hassan

Re: Matcher/Mailet clauses order of execution

Posted by Özgür EROĞLU <oe...@gmail.com>.
Hi

Order of execution is the order of declaration in the configuration file.
But if you are trying to execute mailets conditionally then you can 
brach the execution using processors with the help of toProcessor class. 
Then you can use SenderHostIs matcher only if SenderIs matches a 
specific value.

Ozgur


On 03/18/2015 07:40 PM, Hassan Latif wrote:
> Hello,
>
> I'm struggling to find some text on this. Is there any specific order of
> execution for the matcher/mailet clauses that are declared in
> mailetcontainer.conf. Let's say we want to first check whether the Sender
> is known (e.g. by using SenderIs matcher) and then check whether the sender
> is from a specific host (using SenderHostIs matcher), is there a way to
> enforce this order of execution?
>
> Appreciate your help.
>
> -Hassan
>


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


Re: Matcher/Mailet clauses order of execution

Posted by Hassan Latif <ha...@gmail.com>.
Thanks a lot Özgür and Benoit for clarifying.

On Thu, Mar 19, 2015 at 11:44 AM, Benoit Tellier <bt...@linagora.com>
wrote:

> Hi,
>
> Have a look to the configuration file conf/mailetcontainer.xml
>
> To understand the order of execution of mailet, follow these simple rules :
>
>  - Starting point : The root processor.
>  - Order of execution : Sequential. The first mailet you see is applied,
> the the second and then the third....
>  - Condition of execution of a mailet : the matcher clause of your
> mailet. If this condition is not satisfied, then this mailet is skipt.
>  - When to stop : No more mailet to execute ( ie : end of a processor )
> or the state of the mail is changed to GHOST ( which can be done by
> mailets : eg LocalDelivery
>  - Conditionnal jump : you have the ToProcessor mailet that moves the
> orocessed e-mail on top of a new processor of your choice. Combined with
> a matcher, you get a conditionnal jump.
>
> So you just have to insert this where needed :
>
> <processor state="someProcessor" enableJmx=true>
>
> ...
>
>     <mailet matcher="SenderIs" class="ToProcessor">
>         <processor>managed-known-sender</processor>
>     </mailet>
>
> </processor>
> ...
>
> <!-- Add this new processor -->
> <processor state="managedd-known-sender" enableJmx=true>
>     <mailet matcher="SenderHostIs" class="..."/>
> </processor>
>
> Le 18/03/2015 18:40, Hassan Latif a écrit :
> > Hello,
> >
> > I'm struggling to find some text on this. Is there any specific order of
> > execution for the matcher/mailet clauses that are declared in
> > mailetcontainer.conf. Let's say we want to first check whether the Sender
> > is known (e.g. by using SenderIs matcher) and then check whether the
> sender
> > is from a specific host (using SenderHostIs matcher), is there a way to
> > enforce this order of execution?
> >
> > Appreciate your help.
> >
> > -Hassan
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

Re: Matcher/Mailet clauses order of execution

Posted by Benoit Tellier <bt...@linagora.com>.
Hi,

Have a look to the configuration file conf/mailetcontainer.xml

To understand the order of execution of mailet, follow these simple rules :

 - Starting point : The root processor.
 - Order of execution : Sequential. The first mailet you see is applied,
the the second and then the third....
 - Condition of execution of a mailet : the matcher clause of your
mailet. If this condition is not satisfied, then this mailet is skipt.
 - When to stop : No more mailet to execute ( ie : end of a processor )
or the state of the mail is changed to GHOST ( which can be done by
mailets : eg LocalDelivery
 - Conditionnal jump : you have the ToProcessor mailet that moves the
orocessed e-mail on top of a new processor of your choice. Combined with
a matcher, you get a conditionnal jump.

So you just have to insert this where needed :

<processor state="someProcessor" enableJmx=true>

...

    <mailet matcher="SenderIs" class="ToProcessor">
        <processor>managed-known-sender</processor>
    </mailet>

</processor>
...

<!-- Add this new processor -->
<processor state="managedd-known-sender" enableJmx=true>
    <mailet matcher="SenderHostIs" class="..."/>
</processor>

Le 18/03/2015 18:40, Hassan Latif a écrit :
> Hello,
>
> I'm struggling to find some text on this. Is there any specific order of
> execution for the matcher/mailet clauses that are declared in
> mailetcontainer.conf. Let's say we want to first check whether the Sender
> is known (e.g. by using SenderIs matcher) and then check whether the sender
> is from a specific host (using SenderHostIs matcher), is there a way to
> enforce this order of execution?
>
> Appreciate your help.
>
> -Hassan
>


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