Changes

Jump to navigation Jump to search
499 bytes added ,  17:29, 16 August 2014
Show totals; reformat command to avoid running off the screen; show sample output.
Line 152: Line 152:  
==Useful Commands==
 
==Useful Commands==
 
===Count messages denied by each DNSBL Block List===
 
===Count messages denied by each DNSBL Block List===
This command scans all qpsmtpd log files closed in the last day and counts the number of messages blocked by each DNS block list.  The count (and the displayed value) is based on the content after "http://" and before the third "/" in the message section of the the log entry.
+
This command scans the qpsmtpd log files closed in the last 3 days and counts the number of messages blocked by each DNS block list.  The count (and the displayed value) is based on the content after "http://" and before the third "/" in the message section of the the log entry.
  awk -F"[\t]" ' /logterse.*dnsbl/ { split($8,msg,"/"); svc=msg[3]; count[svc]++;} END {for (j in count) print count[j] "\t" j;}' $(find /var/log/qpsmtpd -ctime -1 -type f)
+
<nowiki>awk -F"[\t]" ' /logterse.*dnsbl/ \
 +
{                               \
 +
split($8,msg,"/");               \
 +
svc=msg[3];                     \
 +
count[svc]++;                   \
 +
count["Total"]++;                \
 +
}                               \
 +
END                             \
 +
{                               \
 +
for (j in count)                 \
 +
print count[j] "\t" j;           \
 +
}'                               \
 +
$(find /var/log/qpsmtpd -ctime -3 -type f)</nowiki>
 +
 
 +
Sample Output:
 +
<nowiki>19867 Total
 +
3336 bbl.barracudacentral.com
 +
369 www.dnsbl.manitu.net
 +
27 www.nosolicitado.org
 +
1859 www.spamcop.net
 +
10918 www.spamhaus.org
 +
3358 www.gbudb.com</nowiki>
 
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]
 
[[Category:Administration:Monitoring]]
 
[[Category:Administration:Monitoring]]
 
[[Category:Mail]]
 
[[Category:Mail]]

Navigation menu