--Pascal Bleser wrote on 12.12.2001 11:41 +0100:

> I've set up such a filter from an example seen on this list:
> 
> if ( /^[:space:]+filename=.*\.vbs\"$/:b || \
>      /^[:space:]+filename=.*\.exe\"$/:b || \
>      /^[:space:]+filename=.*\.com\"$/:b || \
>      /^[:space:]+filename=.*\.pif\"$/:b || \
>      /^[:space:]+filename=.*\.scr\"$/:b || \
>      /^[:space:]+filename=.*\.bat\"$/:b )
>      {
>            xfilter "/usr/local/courier/bin/reformail -A'X-Antispam: Possible
> Virus'"            /^Subject: !.*/
>            xfilter "/usr/local/courier/bin/reformail -I'Subject: [CAUTION:
> POSSIBLE VIRUS] $MATCH2'"   }

The above filter wont catch much attachments, drop something
like this into $COURIER_HOME/etc/maildroprc:


VERBOSE=9
echo "X-Content-Scan: $HOSTNAME"
xfilter "reformail -A'X-Content-Scan: $HOSTNAME'"

if ( /^content-type: !multipart.*![:space:]/h )
{
echo "X-Content-Filter: $MATCH2"
xfilter "reformail -A'X-Content-Filter: $MATCH2'"

if (
/[:space:](file)?name=\"!.*\.((vbs)|(scr)|(exe)|(com)|(pif)|(lnk)|(bat))!\"$/:b
)
{
FILENAME=$MATCH2
echo "X-Content-Warning: $FILENAME"
xfilter "reformail -A'X-Content-Warning: $FILENAME'"

/^subject: !.*/
xfilter "reformail -I'Subject: [VIRUS WARNING: $FILENAME] $MATCH2'"
}
}

And the result should be:

X-Content-Scan: sandbox.dmz
X-Content-Filter: multipart/mixed;
X-Content-Warning: RunMe.bat
Subject: [VIRUS WARNING: RunMe.bat] test 55


Maildrop has some troubles locating the directory tmp,
I had to create the completely useless dir-structure

$HOME/$COURIER_HOME/var/tmp

instead of simply $HOME/tmp. The logs will tell as always...

Roland


> /etc/courier/enablefiltering:
> esmtp

You are mixing up completely different ways of filtering.


_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to