Re: [exim] Doamin Stats

Top Page
Delete this message
Reply to this message
Author: Daniel Tiefnig
Date:  
To: exim-users
Subject: Re: [exim] Doamin Stats
Renaud Allard wrote:
> It works very well with the -byedomain flag (or -bydomain).
>
> I get this kind of output (amongst the rest):
> Top 50 sending edomains by volume

[...]

Yes, but that won't show statistics for local recipient domains, (local
deliveries) what would be a major point of interest here.
The -pattern also wouldn't do the trick, as capturing is not supported,
(AFAICS from the source) so one would have to set up one expression for
each local domain.
I think there could be an additional switch, like -localbyedomain. It
may not seem very useful, as -byedomain exists, but it will provide a
list of local domains only, so I think some people (like me) may want to
use it. I can try to provide a patch if I manage to understand the code
enough. Comments welcome.

lg,
daniel

PS: The eximstats source is really great, I can't decide which part I
like most. But the #IFDEFs are definitely one of my favourites. ;o)

PPS: At line 2079 of the snapshot eximstats there's:
my($parent) = $_ =~ /(<[^@]+@?[^>]*>)/;
I think it should be reduced to just:
/ (<.+?>) /
This might look way too simple, but actually it is quite clever, and the
best we can get without too much effort. It doesn't even get tricked by
angle brackets or "@" signs in local-parts, like the original solution.[0]
It still fails on double quoted local-parts with " <" or "> " sequences,
but due to the exim logging style I can't see how this could be avoided:
=> tst <2@???> bar <tst\ \<2\@tst.fo\>\ bar@???> F=...
or
=> tst <2@???> bar <"tst <2@???> F=...
How can we tell where the local part ends? (Think about local-parts that
contain strings like " F=<"...) This also affects the split a few lines
above in the source.
Of course one may argue, that these local-parts are not THAT common.

[0] try this:
perl -lpe'$_.=join"","\nold: ",/(<[^@]+@?[^>]*>)/,"\nnew: ",/ (<.+?>) /'

on some of those lines:
test2test <test2test@???> F=<root@???>
test2test <test2test> F=<root@???>
test<2test <test\<2test@???> F=<root@???>
test<2test <"test<2test"@???> F=<root@???>
test2@test> <test2\@test\>@example.com> F=<root@???>
test2@test> <"test2@???> F=<root@???>
test<2@test> <test\<2\@test\>@example.com> F=<root@???>
test<2@test> <"test<2@???> F=<root@???>