> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Maxwell Ochieng > Sent: Wednesday, December 03, 2003 12:18 AM > To: [EMAIL PROTECTED] > Subject: [Qmail-scanner-general]limiting the size of mail > qmail-scanner > scans > > > I want to limit the size of mail my perlscanner is allowed to scan to > something like 1MB and any mail which is more than 1MB is not scanned. > > Please someone advice > > Maxwell > >
Just chain a script in the pipe before QS that makes that decision. It would not be difficult to create a simple BASH script that replaces qmail-scanner.pl in /etc/tcp.smtp like: QMAILQUEUE="/var/qmail/bin/script". The script would check the message size and either pipes it out to qmail-scanner.pl or skips it. This simple example script just takes the message and sends it to spamc then pipes that output to qmail-scanner.pl: ===== #!/bin/bash /usr/local/bin/spamc -f | /var/qmail/bin/qmail-scanner-queue.pl ===== or this script which is run by my customers .qmail file and checks for the SA spam tag=yes, and if found moves the message to a SPAM folder: ===== #!/bin/bash # # Test for SPAM msg and move to .SPAM folder # message="`date +%s$RANDOM`.msg" cat > $message subject=`grep '^X-Spam-Flag: YES*' $message` SPAM=$? # this echos X-Spam-Flag: YES into the qmail-send log like: # 2003-12-02 19:44:10.765844500 info msg 834128: bytes 2300 from <[EMAIL PROTECTED]> qp 25366 uid 516 # 2003-12-02 19:44:10.771783500 starting delivery 620: msg 834128 to local [EMAIL PROTECTED] # 2003-12-02 19:44:10.771945500 status: local 1/10 remote 0/20 # 2003-12-02 19:44:10.804990500 delivery 620: success: X-Spam-Flag:_YES/did_0+0+1/ <---HERE echo "$subject" #sender=`grep '^From:' $message | grep -o '[EMAIL PROTECTED]'` #echo "Sender: $sender" if [ $SPAM = 0 ]; then mv $message ./Maildir/.SPAM/new/$message exit 0 fi mv $message ./Maildir/new/$message exit 0 ===== This should give you some ideas. Hope this helps. Ken ------------------------------------------------------- This SF.net email is sponsored by OSDN's Audience Survey. Help shape OSDN's sites and tell us what you think. Take this five minute survey and you could win a $250 Gift Certificate. http://www.wrgsurveys.com/2003/osdntech03.php?site=8 _______________________________________________ Qmail-scanner-general mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general