Ok... Here's my purpose:
Decouple match and mailet element in the conf so that first define the
processing tree and seconds fill it. Here's an example:
<processingPipe>
<match condition="Spam">
<mailet name="Null"/>
</match>
<match condition="RecipientIsLocal">
<mailet name="Log"/>
<match condition="[EMAIL PROTECTED]">
<mailet name="top-secretDecript"/>
</match>
<match condition="RecipientIs=[mailinglist]">
<match condition="HasAttacment">
<mailet name="BounceAttachment"/>
</match>
<match condition="RecipientIs=mylist">
<mailet name="Mylist"/>
</match>
<match condition="RecipientIs=yourlist">
<mailet name="Yourlist"/>
</match>
</match>
<match condition="RecipientIs=[lowusers]">
<match condition="SizeIsOver=500k">
<mailet name="BounceOversize"/>
</match>
<mailet name="LocalDelivery"/>
</match>
<match condition="RecipientIs=[highusers]">
<match condition="SizeIsOver=2000k">
<mailet name="BounceOversize"/>
</match>
<match condition="UserIs="pluto">
<mailet name="plutoForward"/>
</match>
<match condition="UserIs="minnie">
<mailet name="minnieImOnVacation"/>
</match>
<match condition="UserIs="topolino">
<mailet name="topolinoForward"/>
</match>
<match condition="UserIs="paperino">
<mailet name="paperinoTranslator"/>
<mailet name="LocalDelivery"/>
</match>
</match>
</match>
<mailet name="RemoteDelivery">
</processingPipe>
This define a tree and each </match> is a leaf where the pipe ends thus
after each match spit a mail (recipients) there is no merge back. I
cannot draw the tree just with ascii... :-(
Nested match are not really necessary but they make easier writing
conditions. Instead of
match="LocalUser & UserIs=pippo"
you can write
<match condition=LocalUser>
<match condition=UserIs=pippo>
...
More than all spitting match element from mailet element allow mailet
chaining whic IMO is a MUST.
The second point is to use names instead of class (instances) inside the
tree definition so that mailet instance can appear in different places
in the tree. Mailet configuration should go somewhere else:
<mailets>
<mailet name="Null" class="Null">
</mailet>
<mailet name="Log" class="LogMailet">
<repository> file://../var/mail/logs/local.log</repository>
</mailet>
<mailet name="top-secretDecript" class="Decriptor">
<secretkey> mykey </secretkey>
</mailet>
<mailet name="BounceAttachment" class="Bounce">
<message> Mail with attachment are not allowed for this
recipient </message>
</mailet>
<mailet name="BounceOversize" class="Bounce">
<message> This mail is over admitted size </message>
</mailet>
<mailet name="Mylist" class="MiniList">
....
</mailet>
<mailet name="LocalDelivery" class="LocalDelivery">
....
</mailet>
<mailet name="plutoForward" class="Forward">
<forwardTo> [EMAIL PROTECTED] </forwardTo>
</mailet>
<mailet name="" class="">
</mailet>
<mailet name="topolinoForward" class="Forward">
<forwardTo> [EMAIL PROTECTED] </forwardTo>
</mailet>
....
</mailets>
Such a sintax should make configuration more readable and powerful
avoiding the risk of a "ad hoc" scripting language.
Any comments?
Fede
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/>
Problems?: [EMAIL PROTECTED]