Changes

Jump to navigation Jump to search
1,239 bytes added ,  15:05, 12 April 2014
use split() instead of substr() (old script always reported max=9). Add example showing how to scan "x" days of log files.
Line 36: Line 36:  
2008-11-08 06:37:41.211401500 26409 logging::logterse plugin: ` 87.103.146.91 pmsn.91.146.103.87.sable.dsl.krasnet.ru pmsn.91.146.103.87.sable.dsl.krasnet.ru <dwtrupsm@trups.com> dnsbl 903 http://www.spamhaus.org/query/bl?ip=87.103.146.91 msg denied before queued</nowiki>
 
2008-11-08 06:37:41.211401500 26409 logging::logterse plugin: ` 87.103.146.91 pmsn.91.146.103.87.sable.dsl.krasnet.ru pmsn.91.146.103.87.sable.dsl.krasnet.ru <dwtrupsm@trups.com> dnsbl 903 http://www.spamhaus.org/query/bl?ip=87.103.146.91 msg denied before queued</nowiki>
   −
=== Increase the number of log files retained ===
+
==== Monitor simultaneous in-bound SMTP connections ====
Some users find that they want to be able to research email problems further back in time than the window covered by the default qpsmtpd logfile retention settings (10 logfiles retained, 5,000,000 bytes each).
+
The command below will show the maximum number of simultaneous in-bound SMTP connections to your server since the last time the qpsmtpd log was rotated.  Replace "/current" with "/*" to get the maximum connection count in all existing qpsmtpd log files.
   −
You can increase the number of logfiles retained by qpsmtpd (to 20 in the example below) using:
+
(The single quotes on the first and last line make this a single command):
 +
<nowiki>awk -v INSTANCES="/"$(config getprop smtpd Instances) 'BEGIN {max=0}
 +
$0 ~ INSTANCES {split($5, count, "/"); count[1]>max?max=count[1]:max}
 +
END {print max}' /var/log/qpsmtpd/current</nowiki>
 +
 
 +
Show the maximum connections in any log file closed in the last 3 days, and include the configured "qpsmtpd Instances" for your system:
 +
<nowiki>awk -v INSTANCES="/"$(config getprop smtpd Instances) 'BEGIN {max=0}
 +
$0 ~ INSTANCES {split($5, count, "/"); count[1]>max?max=count[1]:max}
 +
END {print max INSTANCES}' $(find /var/log/qpsmtpd/ -name "@*" -ctime -3)</nowiki>
 +
 
 +
===Allow for individual configuration of qpsmtpd and sqpsmtpd log file retention ===
 +
Some users find that they want to be able to research email problems further back in time than the window covered by the default qpsmtpd logfile retention settings (10 logfiles retained, 5,000,000 bytes each). See [[Bugzilla: 6293]] and [[Bugzilla: 2862]]
 +
 
 +
Beginning with smeserver-qpsmtpd-2.2.0-12.el5.sme (SME 8) you can increase the number of logfiles retained by qpsmtpd (to 20 in the examples below) using:
 
  <nowiki>config setprop qpsmtpd KeepLogFiles 20
 
  <nowiki>config setprop qpsmtpd KeepLogFiles 20
 
sv stop qpsmtpd
 
sv stop qpsmtpd
Line 50: Line 63:  
kill -HUP `cat /var/service/sqpsmtpd/log/supervise/pid`
 
kill -HUP `cat /var/service/sqpsmtpd/log/supervise/pid`
 
sv start sqpsmtpd</nowiki>
 
sv start sqpsmtpd</nowiki>
 +
 +
{{Warning box|Using a KeepFiles setting of 1 is an extreme setting only to be used for a specific test system with a low volume of emails.}}
    
== qmail: Outgoing SMTP traffic ==
 
== qmail: Outgoing SMTP traffic ==

Navigation menu