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 Raied Naieem <na...@fileants.com> on 2002/09/24 12:04:00 UTC

Newbie: Mailet only for incoming mails

Hi guys, 
   I have written a mailet to filter attachments. I would like the
attachment to be filtered only for incoming mails. Any idea how this can be
done?
I've tried putting the mailet with (match="RecipientIsLocal") but then
you'll have the following scenario:
   Send a mail with:
	To: myAccount@localServer.com, myAccount@external.com

The mail will be sent to the mailet and will be filtered for both
recepients.
I've been fighting for weeks now. Acctually in the specification of James it
says that mailets are only meant to process _incoming_ mails. Am I doing
anything wrong?

Here is the only mailet part I've changed in config.xml (the root process).

Cheers and Thanks, 
Raied

******************************************************

<processor name="root">

        <mailet match="All" class="AttachmentFilter">
        </mailet>
	<mailet match="RelayLimit=30" class="Null">
          </mailet>

          <!-- Check for delivery from a known spam server -->
          <mailet match="InSpammerBlacklist=blackholes.mail-abuse.org"
                  class="ToProcessor">
            <processor> spam </processor>
            <notice> Rejected - see  http://www.mail-abuse.org/rbl/
</notice>
          </mailet>

          <mailet match="InSpammerBlacklist=dialups.mail-abuse.org"
                  class="ToProcessor">
            <processor> spam </processor>
            <notice> Dialup - see http://www.mail-abuse.org/dul/ </notice>
          </mailet>

          <mailet match="InSpammerBlacklist=relays.mail-abuse.org"
                  class="ToProcessor">
            <processor> spam </processor>
            <notice> Open spam relay - see http://www.mail-abuse.org/rss/
</notice>
          </mailet>

          <!-- Sample matching to kill a message (send to Null) -->
          <mailet match="RecipientIs=badboy@badhost" class="Null">
          </mailet>

          <!-- Sends remaining mails to the transport processor for either
          local or remote delivery -->
          <mailet match="All" class="ToProcessor">
            <processor> transport </processor>
          </mailet>
 </processor>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Newbie: Mailet only for incoming mails

Posted by Danny Angus <da...@apache.org>.
> I've tried putting the mailet with (match="RecipientIsLocal") but then
> you'll have the following scenario:
>    Send a mail with:
> 	To: myAccount@localServer.com, myAccount@external.com
>
> The mail will be sent to the mailet and will be filtered for both
> recepients.

Thats the correct behaviour, it looks like you need to make your mailet
distinguish between a version for local delivery and one for the remote
recipient.

d.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>