X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/9242a7e8cfa94bbc9dd7eca6bd651b569b871c4e..107077d7fd6736711bf5cd980221723401d37c51:/src/src/eximstats.src diff --git a/src/src/eximstats.src b/src/src/eximstats.src index 80ac93372..232b3d135 100644 --- a/src/src/eximstats.src +++ b/src/src/eximstats.src @@ -1,7 +1,9 @@ #!PERL_COMMAND +# Copyright (c) The Exim Maintainers 2023 # Copyright (c) 2001-2017 University of Cambridge. # See the file NOTICE for conditions of use and distribution. +# SPDX-License-Identifier: GPL-2.0-or-later # Perl script to generate statistics from one or more Exim log files. @@ -533,7 +535,7 @@ about how to create charts from the tables. =head1 AUTHOR -There is a web site at http://www.exim.org - this contains details of the +There is a website at https://www.exim.org - this contains details of the mailing list exim-users@exim.org. =head1 TO DO @@ -552,10 +554,18 @@ use integer; BEGIN { pop @INC if $INC[-1] eq '.' }; use strict; use IO::File; +use File::Basename; # use Time::Local; # PH/FANF use POSIX; +if (@ARGV and ($ARGV[0] eq '--version' || $ARGV[0] eq '-v')) { + print basename($0) . ": $0\n", + "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n", + "perl(runtime): $]\n"; + exit 0; +} + use vars qw($HAVE_GD_Graph_pie $HAVE_GD_Graph_linespoints $HAVE_Spreadsheet_WriteExcel); eval { require GD::Graph::pie; }; $HAVE_GD_Graph_pie = $@ ? 0 : 1; @@ -1890,7 +1900,11 @@ sub generate_parser { next if ($length < 38 + $extra); } - $id = substr($_, 20 + $extra, 16); + # $id = substr($_, 20 + $extra, 16); # old ID was 16 chars + $id = substr($_, 20 + $extra, 23); # new IS is 23 chars + $id =~ s/(\S+).*/$1/; + $extra += length($id) - 16; + $flag = substr($_, 37 + $extra, 2); if ($flag !~ /^([<>=*-]+|SA)$/ && /rejected|refused|dropped/) {