Hi everybody,

I thought this might be useful for you just as it is for us. I wrote a
small script that works as a filter between an MTA and otrs and filters
spam and viri before they hit a queue.

Sorry if anybody else came up with this idea before, there's no seach
available in the archives :-)

The script requires SpamAssassin and ClamAV installed in daemon mode.
See http://www.spamassassin.org and http://www.clamav.net for more info.
It should be pretty easy to modify the script so it doesn't rely upon
daemon mode for both programs.

--- Name it 'spamclam.sh' and put it into /home/otrs ---

#!/bin/sh

# This script takes a mail from STDIN, runs virus and spam scans
# on it and if it passes, pipes it into $ARGV[1]. Otherwise
# writes it into otrs-virusbox or otrs-spambox respectively.
#
# Written by Michael otto <[EMAIL PROTECTED]>. Released under GPL.

HOME=/home/otrs
TMP=/tmp

cat >$TMP/mail.tmp.$$

VIRUS=`clamdscan --disable-summary --stdout $TMP/mail.tmp.$$ | grep FOUND`

if [ "${VIRUS}" == "" ];
then
        SPAM=`spamc -u otrs -r < $TMP/mail.tmp.$$`

        if [ "${SPAM}" == "" ];
        then
                cat $TMP/mail.tmp.$$ | $1
        else
                cat $TMP/mail.tmp.$$ >>$HOME/otrs-spambox
        fi
else
        cat $TMP/mail.tmp.$$ >>$HOME/otrs-virusbox
fi

rm $TMP/mail.tmp.$$

---

Now patch your alias file which pipes the mail into PostMaster.pl like this:

local_part: "|/home/otrs/spamclam.sh /opt/otrs/bin/PostMaster.pl"

---

Regards,

Michael
--
Michael Otto, Dipl.-Inform.

epublica
Internet-Technologie: Konzeption, Produktion, Wartung
Wartenau 8
D-22089 Hamburg

[EMAIL PROTECTED]
http://www.epublica.de
Tel. +49 (0)40/4109879-1
Fax  +49 (0)40/4109879-9






_______________________________________________ OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs Support oder Consulting für Ihr OTRS System? => http://www.otrs.de/

Reply via email to