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 Vincenzo Gianferrari Pini <vi...@praxis.it> on 2003/06/08 20:56:03 UTC

[no virus] [PATCH] New redirect - config options added to AbstractNotify

Noel,

here attached is a patch to the seven "New Redirect" classes both in head and branch_2_1_fcs.

The changes are all related:

1) The sender domain check now is optional, controlled by <fakeDomainCheck>, that defaults to true.

2) Some "getX()" values where hardcoded in AbstractNotify; now they are controlled by init parameters that default to the previous values. The parameters involved are: <prefix>, <inline>, <attachment> and <passThrough>.

3) In AbstractNotify (and subclasses) <message> and <attachError> can be used instead of <notice> and <attachStackTrace>.

4) Javadoc changed accordingly plus a few fixes.

The change #2 above allows to add in config.xml something like:

        <!-- Check attachment extensions for possible viruses -->
         <mailet match="AttachmentFileNameIs=*.exe,*.com,*.bat,*.pif,*.scr,*.vbs,*.eml,*.avi,*.mp3,*.mpeg,*.shs" class="Bounce">
            <inline>heads</inline>
            <attachment>none</attachment>
            <passThrough>false</passThrough>
            <prefix>[REJECTED]</prefix>
            <message>
The Security Policy of ACME Corp. does not allow to forward messages containing attachments having any of the extensions .exe, .com, .bat, .pif, .scr, .vbs, .eml, .avi, .mp3, .mpeg, .shs, therefore such messages are rejected. Please don't reply to this e-mail as it has been automatically sent by the antivirus system.

Regards, Postmaster acme.com
-----------------------------
            </message>
         </mailet>

The <attachment>none</attachment> was not allowed before in Bounce, and the default was "message", and in such a case, if the message had an infected attachment, it would have been bounced back to the (possibly fake) sender together with the virus.

I've tested everything and it is hopefully OK.

Bye,

Vincenzo