]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Avoid counting mail twice
authoreldy <>
Thu, 4 Sep 2008 22:31:55 +0000 (22:31 +0000)
committereldy <>
Thu, 4 Sep 2008 22:31:55 +0000 (22:31 +0000)
docs/awstats_changelog.txt
tools/maillogconvert.pl

index faa2b2c4c5856ec69eeacbf8eafcd3789222f13d..04a5f2afe518ceb52479fe0bf4e66f2f3b173266 100644 (file)
@@ -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
 
index 1f24f42041493ae6e038f680aaa7c9f70d2f5de7..d42e0c520b75339a8afede81043ea043414d3873 100644 (file)
@@ -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=<webmaster@example.com>, 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