Changes

Jump to navigation Jump to search
290 bytes added ,  18:01, 17 August 2014
Line 152: Line 152:  
==Useful Commands==
 
==Useful Commands==
 
===Count messages denied by DNSBL Block Lists===
 
===Count messages denied by DNSBL Block Lists===
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.
+
This command:
  <nowiki>awk -F"[\t]" ' /logterse.*dnsbl/ \
+
* asks you how many days of logfiles to scan
 +
* scans the logfiles closed in the days specified
 +
* counts the number of messages blocked by each DNS list that blocked an email.   
 +
 
 +
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 (which frequently differs from the value specified in the config db).
 +
  <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.*dnsbl/ \
 
{                                \
 
{                                \
 
split($8,msg,"/");              \
 
split($8,msg,"/");              \
Line 165: Line 173:  
print count[j] "\t" j;          \
 
print count[j] "\t" j;          \
 
}'                              \
 
}'                              \
$(find /var/log/qpsmtpd -ctime -3 -type f)</nowiki>
+
$(find /var/log/qpsmtpd /var/log/sqpsmtpd -ctime -$DAYS -type f)</nowiki>
    
Sample Output:
 
Sample Output:

Navigation menu