> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Michael Menefee
> Sent: Wednesday, November 12, 2003 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: [Qmail-scanner-general]Quarantine Question
>
>
> All:
> Wondering if there's  a way to modify qmail-scanner-queue.pl
> to quarantine
> messages that SpamAssasin has marked at a certain threshold,
> rather than
> delete the message. Running an email gateway with Qmail,
> Qmail-scanner 1.16
> and Spamassassin 2.55. Any thoughts are appreciated
>
> Thanks
>
> --
> Michael Menefee, CISSP
> Senior Security Consultant
> U.S. Networks, Inc.
> (919) 256-1694
> [EMAIL PROTECTED]
>

Mike,

In my setup, qmail-smtpd calls a bash script which pipes to spamc then pipes
to QS. Nice plumbing eh? Then a .qmail file runs another script which
filters and moves SPAM to a folder:
-----------------------------------------------------------------
.qmail file:
-----------------------------------------------------------------
|./script
-----------------------------------------------------------------
/home/user/script:
-----------------------------------------------------------------
#!/bin/bash
#
# Test msg for +SA indicators and move to .SPAM folder
#

# generate uniq filename for msg
message="`date +%s$RANDOM`.msg"

# write message to disk
cat > $message

# check for SA indicator
# this could also be based on LEVEL with something like
# subject=`egrep '^X-Spam-Level: \*{8,}' $message`
# just replace 8 with the number of asterisks you want
# i have not really used the above...
subject=`grep '^X-Spam-Flag: YES*' $message`
SPAM=$?

# this will echo "X-Spam-Flag:_YES" (or $subject) into your qmail-send log
like:
# delivery 72: success: X-Spam-Flag:_YES/did_0+0+1/
echo "$subject"

# not being used, i don't care
# get address in From: header
#sender=`grep '^From:' $message | grep -o
'[EMAIL PROTECTED]'`
# echo to qmail-send log
#echo "Sender: $sender"

# if it's a BAD msg
# then move to SPAM folder
if [ $SPAM = 0 ]; then
mv $message ./Maildir/.SPAM/new/$message
exit 0
fi

# else move to regular inbox
mv $message ./Maildir/new/$message
exit 0
-----------------------------------------------------------------

I love the way this stuff all works. You can do anything with a silly little
bash script like this.

Ken




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to