Changes

Jump to navigation Jump to search
748 bytes added ,  13:26, 21 September 2015
Display counts of messages by plugin / disposition
Line 184: Line 184:  
10918 www.spamhaus.org
 
10918 www.spamhaus.org
 
3358 www.gbudb.com</nowiki>
 
3358 www.gbudb.com</nowiki>
 +
 +
===Count messages by qpsmtpd disposition===
 +
Scan the qpsmtpd logfiles closed in the last X days and display counts of messages for each disposition (plugin name or 'queued')
 +
<nowiki>if [ -z $DAYS ]; then DAYS=1; fi; \
 +
echo -n "Days of logfiles to scan [$DAYS]: "; read NEWDAYS; \
 +
if [ $NEWDAYS ]; then DAYS=$NEWDAYS; fi; \
 +
awk -F"[\t]" ' /logterse plugin/ { svc=$6; count[svc]++; count["Total"]++; }  END  { for (j in count) print count[j] "\t" j; }' \
 +
$(find /var/log/qpsmtpd /var/log/sqpsmtpd -ctime -$DAYS -type f) \
 +
|sort -nr</nowiki>
 +
 +
Sample output:
 +
<nowiki>4213 Total
 +
1830 dnsbl
 +
1773 queued
 +
524 tls
 +
37 check_earlytalker
 +
18 spamassassin
 +
10 check_badmailfrom_patterns
 +
9 check_goodrcptto
 +
6 check_spamhelo
 +
6 auth::auth_cvm_unix_local</nowiki>
    
===Display messages that would have been blocked via DNSBL===
 
===Display messages that would have been blocked via DNSBL===

Navigation menu