From: eldy <> Date: Thu, 4 Sep 2008 22:31:55 +0000 (+0000) Subject: Avoid counting mail twice X-Git-Tag: AWSTATS_6_9_BETA~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd00ff5664f423b11145ae5902e46f602c04ced8;p=thirdparty%2FAWStats.git Avoid counting mail twice --- diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index faa2b2c4..04a5f2af 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -5,11 +5,13 @@ $Revision$ - $Author$ - $Date$ ***** 6.9 ***** New features/improvements: -- None +- With postfix that support DSN (Delivery Status Notifications) we exclude some + lines to avoid counting mails twice in maillogconvert.pl script. Fixes: - Fixed broken maxmind citi, org and isp plugins. - Fix: Security fix 2001151. + Other/Documentation: - None diff --git a/tools/maillogconvert.pl b/tools/maillogconvert.pl index 1f24f420..d42e0c52 100644 --- a/tools/maillogconvert.pl +++ b/tools/maillogconvert.pl @@ -494,7 +494,15 @@ while (<>) { # If 'forwarded as idnewmail' is found, we discard this mail to avoid counting it twice debug("For id=$id, mail was forwarded to other id, we discard it"); delete $mail{$id}; - } + } + ########################################### + elsif (m/\s*dsn=2.6.0\s*/) { + # if the DSN is not 2.0.0, we discard this mail to avoid counting it twice + # postfix: Aug 29 19:22:38 example postfix/smtp[1347]: D989FD6C302: to=, relay=127.0.0.1[127.0.0.1]:10024, delay=2.9, delays=0.31/0.01/0/2.6, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=01182-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 995DCD6C315) + debug("For id=$id, mail DSN is not 2.0.0, we discard it"); + delete $mail{$id}; + } + ########################################### else { if (m/\s+orig_to=([^\s,]*)[\s,]/) { # If we have a orig_to, we used it as receiver