diff --git a/bin/gatherstats.pl b/bin/gatherstats.pl index bb58252..e47f51f 100755 --- a/bin/gatherstats.pl +++ b/bin/gatherstats.pl @@ -301,16 +301,16 @@ sub HostStats { if (!$Host) { if ($Header{'path'} =~ /!([^!]+)!.POSTED!/) { $Host = "$1"; - } elsif ($Header{'path'} =~ /!.POSTED.([^!]+)!/) { + } elsif ($Header{'path'} =~ /([^!]+)!.POSTED.[^!]+!?/) { $Host = "$1"; } else { # iterate on the Path: header until we have a host name or no more # path elements while (!$Host && $Header{'path'} =~ /!/) { - ($Host) = $Header{'path'} =~ /!?([a-z0-9-_]+\.[a-z0-9-_.]+)![^!]+$/i; + ($Host) = $Header{'path'} =~ /!?([a-z0-9-_]+\.[a-z0-9-_.]+)!!?[^!]+!?$/i; undef($Host) if $Host && $Host =~ /\.MISMATCH/; # remove last path element - $Header{'path'} =~ s/![^!]+$//; + $Header{'path'} =~ s/!!?[^!]+$//; }; } }