Package: munin-node Version: 1.2.2-3 Followup-For: Bug #302220 The uploaded fix to this, doesn't catch everything, it misses:
postfix/smtpd[26330]: warning: reject: ETRN from somehost.edu[xxx.xxx.xxx.xxx] To continue using the method that was there before, it would be expanded to: elsif (($line =~ /reject: \S+ \S+ \S+ (\S+)/) && (!($line =~ /\/cleanup\[\d+\].*reject:/)) && (!($line =~ /reject: ETRN/))) but, this is getting ugly, why not do: elsif (($line =~ /reject: \S+ \S+ \S+ (\d{3})/) See attached diff for all the information and changes. ps - I noticed that this was closed, but the issue of counting header and body rejects separately from numbered rejects (550, 554, etc.) was not addressed...? Micah -- System Information: Debian Release: 3.1 APT prefers unstable APT policy: (300, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.8-vs1.9.5 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages munin-node depends on: ii libnet-server-perl 0.87-3 An extensible, general perl server ii perl 5.8.4-8 Larry Wall's Practical Extraction ii procps 1:3.2.5-1 /proc file system utilities -- no debconf information
--- postfix_mailstats 2005-03-31 18:37:38.000000000 -0800 +++ /tmp/postfix_mailstats 2005-04-07 21:29:11.133181723 -0700 @@ -229,7 +229,29 @@ { $delivered++; } - elsif (($line =~ /reject: \S+ \S+ \S+ (\S+)/) && (!($line =~ /\/cleanup\[\d+\].*reject:/))) + + # Look for lines that have reject: in them, and count up the number of reject codes + # For example, the following entry would increase the counter for reject code 554 + # + # postfix/smtpd[18762]: NOQUEUE: reject: RCPT from somehost.edu[xxx.xxx.xxx.xxx]: 554 Service unavailable; + # Client host [xxx.xxx.xxx.xxx] blocked using list.dsbl.org from=<[EMAIL PROTECTED]> + # to=<[EMAIL PROTECTED]> proto=SMTP helo=<somehost.edu> + # + # but there are some cases where reject codes are not included, so we ignore the following cases (possibly more!): + # + # postfix/cleanup[22101]: F28EF3D318: reject: header Subject: Important notify about your e-mail account. from + # somehost.edu[xxx.xxx.xxx.xxx]; from=<[EMAIL PROTECTED]> to=<[EMAIL PROTECTED]> + # proto=SMTP helo=<Viking1>: Rejected, probably sent by virus W32/Bagle + # + # postfix/smtpd[26330]: warning: reject: ETRN from somehost.edu[xxx.xxx.xxx.xxx] + # + # This was being done this way: + # + # elsif (($line =~ /reject: \S+ \S+ \S+ (\S+)/) && (!($line =~ /\/cleanup\[\d+\].*reject:/)) && (!($line =~ /reject: ETRN/))) + # + # but could be done much simpler this way (I think): + + elsif (($line =~ /reject: \S+ \S+ \S+ (\d{3})/) { $rejects->{$1} ++; }