[Exim] Two bugs(?) in eximstats fixed (fwd)

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Steve Campbell
Datum:  
To: exim-users
CC: andy, Philip Hazel
Betreff: [Exim] Two bugs(?) in eximstats fixed (fwd)
Andy,
    Thanks for the bug report, and bugs they certainly are! I've
incorporated your diffs into the latest version of eximstats, which is
now version 1.21, available from:


http://www.cyberenet.net/~sten/eximstats-1.21.src

md5 eximstats-1.21.src
MD5 (eximstats-1.21.src) = 8b20315550f136a3a2d0cce4cfa6ea57

cksum eximstats-1.21.src
3042373863 74326 eximstats-1.21.src

Steve


---------- Forwarded message ----------
Date: Wed, 4 Sep 2002 00:42:44 +0200
From: Andreas J Mueller <andy@???>
To: Philip Hazel <ph10@???>
Subject: [Exim] Two bugs(?) in eximstats fixed

Hi Philip!

I think I have identified and fixed two bugs in the eximstats script:

1. When using -bydomain, local deliveries were incorrectly attributed
to whatever domain was previously stored in the $domain variable.
This variable would only be updated when the log line contains a
H=<host> entry, which is not the case for local deliveries (see
below). It now defaults to "localdomain".

2002-09-01 05:00:01 17lKy1-0005Qw-00 => andy <andy@???>
F=<mm-admin@???> R=localuser T=local_delivery S=1914

2. I use log lines which contain the envelope-from header in outgoing
deliveries (see below, a). When using -t_remote_users, the
matching and extraction of the destination address fails, because
it matches on the address in the F=<envelope-from> entry. I have
modified the regex to include a space before the "<". This still
does not work correctly for pathetic cases like b), which contain
an "email address" in the SMTP confirmation message, but it's the
best I can offer you right now.

a) 2002-09-01 05:00:02 17lKy1-0005Qy-00 => peter@???
F=<mm-admin@???> R=dnslookup T=remote_smtp S=1701
H=mx00.schlund.de [212.227.126.151] C="250 OK id=17lKy2-0005tq-00" b)
2002-09-01 05:00:04 17lKy2-0005RK-00 => k.baltes@???
F=<mm-admin@???> R=dnslookup T=remote_smtp S=1697
H=mail.epost.de [193.28.100.151] C="250 <3D6C695F0004D803> Mail
accepted"

Diff included below and as attachment (hope you don't mind, it's short
enough anyway). My apologies if these bugs are already fixed, they
haven't been in the exim-snapshot the last time I checked.

Yours, Andy

--- src/eximstats.src
+++ src/eximstats.src
@@ -790,6 +790,7 @@
     $_ = substr($_, 40);


     $host = "local";           #Host is local unless otherwise
 specified. +    $domain = "localdomain";   #Domain is localdomain
 unless otherwise specified.


     # Do some pattern matches to get the host and IP address.
     # We expect lines to be of the form "H=[IpAddr]" or "H=Host
 [IpAddr]" or @@ -946,7 +947,7 @@
        if ($host ne "local") {         #Store remote users only.
        #ENDIF ($include_remote_users && ! $local_league_table)


-         if (my($user) = split((/</)? " <" : " ", $_)) {
+         if (my($user) = split((/\\s</)? " <" : " ", $_)) {
            if ($user =~ /^[\\/|]/) {
              my($parent) = $_ =~ /(<[^@]+@?[^>]*>)/;
              $user = "$user $parent" if defined $parent;


--
Andreas J. Mueller                            email: <andy@???>
PGP RSA Public Key ID 0x3D41D941 FP: ED261973D51D3D20 C840B0542E69F602