[exim-dev] [Bug 483] New: eximstats patch fixes html table h…

Top Page
Delete this message
Reply to this message
Author: bug483
Date:  
To: exim-dev
Subject: [exim-dev] [Bug 483] New: eximstats patch fixes html table headers, html anchors for top counts, ehlo checks
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=483

           Summary: eximstats patch fixes html table headers, html anchors
                    for top counts, ehlo checks
           Product: Exim
           Version: 4.66
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: bug
          Priority: low
         Component: Eximstats
        AssignedTo: ph10@???
        ReportedBy: jez.hancock@???
         QAContact: exim-dev@???



I came across a few minor problems with Eximstats when trying to output stats
in HTML format - mostly HTML markup issues, though one fix is for checking of
bad EHLO checks.

The complete patch against src/eximstats.src v4.66 is at the end of this
message.

The original mail I was going to send to the mailing list is below:

-snip-
Find attached a patch against src/eximstats.src (v4.66) that modifies eximstats
to fix:

- printing of all table column headers in 'html' mode:
==
@@ -1359,7 +1359,7 @@
 <tr><td>
 <table border=1>
 EoText
-    print $htm_col_headers;
+    print $htm_fh $htm_col_headers;
   }


if ($xls_fh) {
==

- html anchors for the top counts:
==
@@ -2437,31 +2437,31 @@

     print $htm_fh "<li><a href=\"#Relayed messages\">Relayed messages</a>\n"
if $show_relay;
     if ($topcount) {
-      print $htm_fh "<li><a href=\"#mail rejection reason count\">Top
$topcount mail rejection reasons by message count</a>\n" if
%rejected_count_by_reason;
+      print $htm_fh "<li><a href=\"#Mail rejection reason count\">Top
$topcount mail rejection reasons by message count</a>\n" if
%rejected_count_by_reason;
       foreach ('Host','Domain','Email','Edomain') {
         next unless $do_sender{$_};
-        print $htm_fh "<li><a href=\"#sending \l$_ count\">Top $topcount
sending \l${_}s by message count</a>\n";
-        print $htm_fh "<li><a href=\"#sending \l$_ volume\">Top $topcount
sending \l${_}s by volume</a>\n";
+        print $htm_fh "<li><a href=\"#Sending \l$_ count\">Top $topcount
sending \l${_}s by message count</a>\n";
+        print $htm_fh "<li><a href=\"#Sending \l$_ volume\">Top $topcount
sending \l${_}s by volume</a>\n";
       }
       if (($local_league_table || $include_remote_users) &&
%received_count_user) {
-        print $htm_fh "<li><a href=\"#local sender count\">Top $topcount local
senders by message count</a>\n";
-        print $htm_fh "<li><a href=\"#local sender volume\">Top $topcount
local senders by volume</a>\n";
+        print $htm_fh "<li><a href=\"#Local sender count\">Top $topcount local
senders by message count</a>\n";
+        print $htm_fh "<li><a href=\"#Local sender volume\">Top $topcount
local senders by volume</a>\n";
       }
       foreach ('Host','Domain','Email','Edomain') {
         next unless $do_sender{$_};
-        print $htm_fh "<li><a href=\"#\l$_ destination count\">Top $topcount
\l$_ destinations by message count</a>\n";
-        print $htm_fh "<li><a href=\"#\l$_ destination volume\">Top $topcount
\l$_ destinations by volume</a>\n";
+        print $htm_fh "<li><a href=\"#$_ destination count\">Top $topcount
\l$_ destinations by message count</a>\n";
+        print $htm_fh "<li><a href=\"#$_ destination volume\">Top $topcount
\l$_ destinations by volume</a>\n";
       }
       if (($local_league_table || $include_remote_users) &&
%delivered_messages_user) {
-        print $htm_fh "<li><a href=\"#local destination count\">Top $topcount
local destinations by message count</a>\n";
-        print $htm_fh "<li><a href=\"#local destination volume\">Top $topcount
local destinations by volume</a>\n";
+        print $htm_fh "<li><a href=\"#Local destination count\">Top $topcount
local destinations by message count</a>\n";
+        print $htm_fh "<li><a href=\"#Local destination volume\">Top $topcount
local destinations by volume</a>\n";
       }


-      print $htm_fh "<li><a href=\"#rejected ip count\">Top $topcount rejected
ips by message count</a>\n" if %rejected_count_by_ip;
-      print $htm_fh "<li><a href=\"#non-rejected spamming ip count\">Top
$topcount non-rejected spamming ips by message count</a>\n" if
%spam_count_by_ip;
+      print $htm_fh "<li><a href=\"#Rejected ip count\">Top $topcount rejected
ips by message count</a>\n" if %rejected_count_by_ip;
+      print $htm_fh "<li><a href=\"#Non-rejected spamming ip count\">Top
$topcount non-rejected spamming ips by message count</a>\n" if
%spam_count_by_ip;


     }
-    print $htm_fh "<li><a href=\"#errors\">List of errors</a>\n" if
%errors_count;
+    print $htm_fh "<li><a href=\"#Errors\">List of errors</a>\n" if
%errors_count;
     print $htm_fh "</ul>\n<hr>\n";
   }
   if ($xls_fh)
==


and finally:

- checking for bad EHLO checks:
==
@@ -2268,7 +2268,7 @@
     if ($flag eq "Re" || ($flag eq "=>" && ! /\\sT=\\S+/)) {
       # Correct the IP address for rejects:
       # rejected EHLO from my.test.net [10.0.0.5]: syntactically invalid
argument(s):
-      $ip = $1 if ($ip eq "local" && /^rejected [HE][HE]LO from .*?
(\[.+?\]):/);
+      $ip = $1 if ($ip eq "local" && /^rejected [HE][EH]LO from .*?
(\[.+?\]):/);
       ++$rejected_count_by_ip{$ip};
       if (
         /(listed at [^ ]+)/ ||
==



--
Jez Hancock
- System Administrator / PHP Developer

http://freebsd.munk.me.uk/      - A FreeBSD Admin Weblog
http://ipfwstats.sf.net/        - ipfw peruser traffic logging
-snip-



Finally, here is the complete patch file against src/eximstats.src 4.66:

-snip-
--- src/eximstats.src   Mon Jan  8 14:25:36 2007
+++ src/eximstats.new   Tue Mar 13 11:44:59 2007
@@ -1359,7 +1359,7 @@
 <tr><td>
 <table border=1>
 EoText
-    print $htm_col_headers;
+    print $htm_fh $htm_col_headers;
   }


   if ($xls_fh) {
@@ -1458,7 +1458,7 @@
 <tr><td>
 <table border=1>
 EoText
-    print $htm_col_headers;
+      print $htm_fh $htm_col_headers;
     }
     if ($xls_fh) {
       $spreadsheet->write(${$row_sref}++, 0, $title, $f_header2);
@@ -2268,7 +2268,7 @@
     if ($flag eq "Re" || ($flag eq "=>" && ! /\\sT=\\S+/)) {
       # Correct the IP address for rejects:
       # rejected EHLO from my.test.net [10.0.0.5]: syntactically invalid
argument(s):
-      $ip = $1 if ($ip eq "local" && /^rejected [HE][HE]LO from .*?
(\[.+?\]):/);
+      $ip = $1 if ($ip eq "local" && /^rejected [HE][EH]LO from .*?
(\[.+?\]):/);
       ++$rejected_count_by_ip{$ip};
       if (
         /(listed at [^ ]+)/ ||
@@ -2437,31 +2437,31 @@


     print $htm_fh "<li><a href=\"#Relayed messages\">Relayed messages</a>\n"
if $show_relay;
     if ($topcount) {
-      print $htm_fh "<li><a href=\"#mail rejection reason count\">Top
$topcount mail rejection reasons by message count</a>\n" if
%rejected_count_by_reason;
+      print $htm_fh "<li><a href=\"#Mail rejection reason count\">Top
$topcount mail rejection reasons by message count</a>\n" if
%rejected_count_by_reason;
       foreach ('Host','Domain','Email','Edomain') {
         next unless $do_sender{$_};
-        print $htm_fh "<li><a href=\"#sending \l$_ count\">Top $topcount
sending \l${_}s by message count</a>\n";
-        print $htm_fh "<li><a href=\"#sending \l$_ volume\">Top $topcount
sending \l${_}s by volume</a>\n";
+        print $htm_fh "<li><a href=\"#Sending \l$_ count\">Top $topcount
sending \l${_}s by message count</a>\n";
+        print $htm_fh "<li><a href=\"#Sending \l$_ volume\">Top $topcount
sending \l${_}s by volume</a>\n";
       }
       if (($local_league_table || $include_remote_users) &&
%received_count_user) {
-        print $htm_fh "<li><a href=\"#local sender count\">Top $topcount local
senders by message count</a>\n";
-        print $htm_fh "<li><a href=\"#local sender volume\">Top $topcount
local senders by volume</a>\n";
+        print $htm_fh "<li><a href=\"#Local sender count\">Top $topcount local
senders by message count</a>\n";
+        print $htm_fh "<li><a href=\"#Local sender volume\">Top $topcount
local senders by volume</a>\n";
       }
       foreach ('Host','Domain','Email','Edomain') {
         next unless $do_sender{$_};
-        print $htm_fh "<li><a href=\"#\l$_ destination count\">Top $topcount
\l$_ destinations by message count</a>\n";
-        print $htm_fh "<li><a href=\"#\l$_ destination volume\">Top $topcount
\l$_ destinations by volume</a>\n";
+        print $htm_fh "<li><a href=\"#$_ destination count\">Top $topcount
\l$_ destinations by message count</a>\n";
+        print $htm_fh "<li><a href=\"#$_ destination volume\">Top $topcount
\l$_ destinations by volume</a>\n";
       }
       if (($local_league_table || $include_remote_users) &&
%delivered_messages_user) {
-        print $htm_fh "<li><a href=\"#local destination count\">Top $topcount
local destinations by message count</a>\n";
-        print $htm_fh "<li><a href=\"#local destination volume\">Top $topcount
local destinations by volume</a>\n";
+        print $htm_fh "<li><a href=\"#Local destination count\">Top $topcount
local destinations by message count</a>\n";
+        print $htm_fh "<li><a href=\"#Local destination volume\">Top $topcount
local destinations by volume</a>\n";
       }


-      print $htm_fh "<li><a href=\"#rejected ip count\">Top $topcount rejected
ips by message count</a>\n" if %rejected_count_by_ip;
-      print $htm_fh "<li><a href=\"#non-rejected spamming ip count\">Top
$topcount non-rejected spamming ips by message count</a>\n" if
%spam_count_by_ip;
+      print $htm_fh "<li><a href=\"#Rejected ip count\">Top $topcount rejected
ips by message count</a>\n" if %rejected_count_by_ip;
+      print $htm_fh "<li><a href=\"#Non-rejected spamming ip count\">Top
$topcount non-rejected spamming ips by message count</a>\n" if
%spam_count_by_ip;


     }
-    print $htm_fh "<li><a href=\"#errors\">List of errors</a>\n" if
%errors_count;
+    print $htm_fh "<li><a href=\"#Errors\">List of errors</a>\n" if
%errors_count;
     print $htm_fh "</ul>\n<hr>\n";
   }
   if ($xls_fh)
-snip-


--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email