Greylisting .. nice ..

Rob Poe rpoe at plattesheriff.org
Tue Feb 6 16:14:14 CET 2007


>>1040 blocked yesterday due to sendmail access.db blocks (the worst
>>subnet offenders from foreign countries)
>>20,000 blocked for invalid recipient
>>124 blocked by RBLs, of which I cannot use all of because their
clients
>>host email servers on DSL / Cable modem connections.
>>68 blocked by spamassassin for high spam score
>>2000 greylist 1st attempts 
>>204 greylist passes

>How did you get these numbers? Do you have a shell script or perl
script
>that parses your logs?

Yup.  PHP shell scripts (don't ask, lol) doing grep -wc commands
against the maillog for the specific day only.  Why did I do it in PHP? 
Quick and dirty, didn't want to have to remember how to do it in BASH ..
don't know PERL well enough to do it there.  Example script below..  One
for each.  I'm sure, that it could be done more prettily - but this does
work..

#!/usr/bin/php -q 
<?
$mday=date("M d");
$mday=str_replace(" 0","  ",$mday);
$cmd="grep \"$mday\" /var/log/maillog | grep -iwc \"WHATEVER YOU WANT
TO SEARCH FOR\"";
$both=exec($cmd);
echo "$both\n";
echo "$both\n";
echo "0\n";
echo "0\n";
?>



More information about the MailScanner mailing list