]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
This commit was manufactured by cvs2git to create tag 'AWSTATS_6_0_RELEASE'. AWSTATS_6_0_RELEASE
authorcvs2git <admin@example.com>
Sun, 25 Jan 2004 15:37:31 +0000 (15:37 +0000)
committercvs2git <admin@example.com>
Sun, 25 Jan 2004 15:37:31 +0000 (15:37 +0000)
Sprout from master 2004-01-14 21:01:08 UTC eldy 'Change Makefile.pl script from DOS to Unix format.'
Cherrypick from master 2004-01-25 15:37:30 UTC eldy 'Remove the AND for ExtraSection in doc':
    tools/maillogconvert.pl
    wwwroot/cgi-bin/awstats.model.conf
    wwwroot/cgi-bin/awstats.pl

tools/maillogconvert.pl
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index 11ef636ebcd637ad2c8b051b6dd30a6da58cc0b3..5e4f33027265408fb326bdf2fcb9a7f0dda6b5d6 100644 (file)
@@ -262,34 +262,11 @@ while (<>) {
                        $mail{$mailid}{'mon'}=$mon;
                        $mail{$mailid}{'day'}=$day;
                        $mail{$mailid}{'time'}=$time;
+                       if (! defined($mail{$mailid}{'size'})) { $mail{$mailid}{'size'}='?'; }
                        debug("For id=$mailid, found a postfix error incoming message: code=$mail{$mailid}{'code'} from=$mail{$mailid}{'from'} to=$mail{$mailid}{'to'} time=$mail{$mailid}{'time'}");
                }
        }
        #
-       # See if we received sendmail reject error
-       #
-       elsif (/, reject/) {
-               $MailType||='sendmail';
-               # Example: 
-               # sm-mta:   Jul 27 04:06:05 androneda sm-mta[6641]: h6RB44tg006641: ruleset=check_mail, arg1=<7ms93d4ms@topprodsource.com>, relay=crelay1.easydns.com [216.220.57.222], reject=451 4.1.8 Domain of sender address 7ms93d4ms@topprodsource.com does not resolve
-               # sm-mta:       Jul 27 06:21:24 androneda sm-mta[11461]: h6RDLNtg011461: ruleset=check_rcpt, arg1=<nobody@nova.dice.net>, relay=freedom.myhostdns.com [66.246.77.42], reject=550 5.7.1 <nobody@nova.dice.net>... Relaying denied
-               # sendmail: Sep 30 04:21:32 halley sendmail[3161]: g8U2LVi03161: ruleset=check_rcpt, arg1=<amber3624@netzero.net>, relay=moon.partenor.fr [10.0.0.254], reject=550 5.7.1 <amber3624@netzero.net>... Relaying denied
-               my ($mon,$day,$time,$id,$ruleset,$arg,$relay_s,$code)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-]+\s+(?:sendmail|sm-mta)\[\d+\]:\s+(.*?):\sruleset=(\w+),\s+arg1=(.*),\s+relay=(.*),\s+(reject=.*)/;
-               $mailid=$id;
-               if ($mailid) {
-                       if ($ruleset eq 'check_mail') { $mail{$id}{'from'}=$arg; }
-                       if ($ruleset eq 'check_rcpt') { $mail{$id}{'to'}=$arg; }
-                       $mail{$id}{'relay_s'}=$relay_s;
-                       # $code='reject=550 5.7.1 <amber3624@netzero.net>... Relaying denied'
-                       if ($code =~ /=(\d\d\d)\s+/) { $mail{$id}{'code'}=$1; }
-                       else { $mail{$id}{'code'}=999; }        # Unkown error
-                       $mail{$id}{'mon'}=$mon;
-                       $mail{$id}{'day'}=$day;
-                       $mail{$id}{'time'}=$time;
-                       debug("For id=$id, found a sendmail error incoming message: code=$mail{$id}{'code'} from=$mail{$id}{'from'} to=$mail{$id}{'to'} relay_s=$mail{$id}{'relay_s'}");
-               }
-       }
-       #
        # See if we received postfix email bounced error
        #
        elsif (/stat(us)?=bounced/) {
@@ -305,9 +282,43 @@ while (<>) {
                        $mail{$mailid}{'mon'}=$mon;
                        $mail{$mailid}{'day'}=$day;
                        $mail{$mailid}{'time'}=$time;
+                       if (! defined($mail{$mailid}{'size'})) { $mail{$mailid}{'size'}='?'; }
                        debug("For id=$mailid, found a postfix bounced incoming message: code=$mail{$mailid}{'code'} to=$mail{$mailid}{'to'} relay_r=$mail{$mailid}{'relay_r'}");
                }
        }
+       #
+       # See if we received sendmail reject error
+       #
+       elsif (/, reject/) {
+               $MailType||='sendmail';
+               # Example: 
+               # sm-mta:   Jul 27 04:06:05 androneda sm-mta[6641]: h6RB44tg006641: ruleset=check_mail, arg1=<7ms93d4ms@topprodsource.com>, relay=crelay1.easydns.com [216.220.57.222], reject=451 4.1.8 Domain of sender address 7ms93d4ms@topprodsource.com does not resolve
+               # sm-mta:       Jul 27 06:21:24 androneda sm-mta[11461]: h6RDLNtg011461: ruleset=check_rcpt, arg1=<nobody@nova.dice.net>, relay=freedom.myhostdns.com [66.246.77.42], reject=550 5.7.1 <nobody@nova.dice.net>... Relaying denied
+               # sendmail: Sep 30 04:21:32 halley sendmail[3161]: g8U2LVi03161: ruleset=check_rcpt, arg1=<amber3624@netzero.net>, relay=moon.partenor.fr [10.0.0.254], reject=550 5.7.1 <amber3624@netzero.net>... Relaying denied
+
+               # sendmail:     Jan 10 07:37:48 smtp sendmail[32440]: ruleset=check_relay, arg1=[211.228.26.114], arg2=211.228.26.114, relay=[211.228.26.114], reject=554 5.7.1 Rejected 211.228.26.114 found in dnsbl.sorbs.net
+               # sendmail: Jan 10 07:37:08 smtp sendmail[32439]: ruleset=check_relay, arg1=235.Red-213-97-175.pooles.rima-tde.net, arg2=213.97.175.235, relay=235.Red-213-97-175.pooles.rima-tde.net [213.97.175.235], reject=550 5.7.1 Mail from 213.97.175.235 refused. Rejected for bad WHOIS info on IP of your SMTP server - see http://www.rfc-ignorant.org/\r
+               # sendmail: Jan 10 17:15:42 smtp sendmail[12770]: ruleset=check_relay, arg1=[63.218.84.21], arg2=63.218.84.21, relay=[63.218.84.21], reject=553 5.3.0 Rejected - see http://spamhaus.org/
+               my ($mon,$day,$time,$id,$ruleset,$arg,$relay_s,$code)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-]+\s+(?:sendmail|sm-mta)\[\d+\][:\s]*(.*?):\sruleset=(\w+),\s+arg1=(.*),\s+relay=(.*),\s+(reject=.*)/;
+               # sendmail: Jan 10 18:00:34 smtp sendmail[5759]: i04Axx2c005759: Milter: data, reject=511 Virus found in email!\r
+               if (! $mon) { ($mon,$day,$time,$id,$ruleset,$code)=m/(\w+)\s+(\d+)\s+(\d+:\d+:\d+)\s+[\w\-]+\s+(?:sendmail|sm-mta)\[\d+\]:\s+(.*?):\s\w+:\s(\w+),\s+(reject=.*)/; }
+               $mailid=(! $id && $mon?'999':$id);      # id not provided in log, we take '999'
+               if ($mailid) {
+                       if ($ruleset eq 'check_mail') { $mail{$mailid}{'from'}=$arg; }
+                       if ($ruleset eq 'check_rcpt') { $mail{$mailid}{'to'}=$arg; }
+                       if ($ruleset eq 'check_relay') { }
+                       if ($ruleset eq 'data') { }
+                       $mail{$mailid}{'relay_s'}=$relay_s;
+                       # $code='reject=550 5.7.1 <amber3624@netzero.net>... Relaying denied'
+                       if ($code =~ /=(\d\d\d)\s+/) { $mail{$mailid}{'code'}=$1; }
+                       else { $mail{$mailid}{'code'}=999; }    # Unkown error
+                       $mail{$mailid}{'mon'}=$mon;
+                       $mail{$mailid}{'day'}=$day;
+                       $mail{$mailid}{'time'}=$time;
+                       if (! defined($mail{$mailid}{'size'})) { $mail{$mailid}{'size'}='?'; }
+                       debug("For id=$mailid, found a sendmail error incoming message: code=$mail{$mailid}{'code'} from=$mail{$mailid}{'from'} to=$mail{$mailid}{'to'} relay_s=$mail{$mailid}{'relay_s'}");
+               }
+       }
 
        #
        # See if we send a sendmail (with ctladdr tag) email
@@ -563,8 +574,9 @@ while (<>) {
                        $to=$mail{$mailid}{'to'};
                        if ($mail{$mailid}{'from'} && $mail{$mailid}{'to'}) { $canoutput=1; }
                        if ($mail{$mailid}{'from'} && $mail{$mailid}{'code'} > 1) { $canoutput=1; }
+                       if ($mailid && $mail{$mailid}{'code'} > 1) { $canoutput=1; }
                }
-               
+
                # If we can
                if ($canoutput) {
                        &OutputRecord($mail{$mailid}{'year'}?$mail{$mailid}{'year'}:$year,$mail{$mailid}{'mon'},$mail{$mailid}{'day'},$mail{$mailid}{'time'},$mail{$mailid}{'from'},$to,$mail{$mailid}{'relay_s'},$mail{$mailid}{'relay_r'},$code,$mail{$mailid}{'size'},$mail{$mailid}{'forwardto'},$mail{$mailid}{'extinfo'});
index 2fbdec3ba487754b6078f25169cb28b6b51b4d99..af442a6a4af5f1ede80725a23e4b42d032b6e95d 100644 (file)
@@ -68,8 +68,8 @@ LogType=W
 # the required log format).
 # Possible values: 1,2,3,4,5 or "your_own_personalized_log_format"
 # 1 - Apache or Lotus Notes/Domino native combined log format (NCSA combined/XLF/ELF log format)
-# 2 - IIS log format (W3C log format)
-# 3 - Webstar native log format
+# 2 - Old IIS log format (IIS W3C log format). See FAQ for IIS 6.x.
+# 3 - Webstar native log format.
 # 4 - Apache or Squid native common log format (NCSA common/CLF log format)
 #     With LogFormat=4, some features (browsers, os, keywords...) can't work.
 # "your_own_personalized_log_format" = If your log is ftp, mail or other format,
@@ -110,10 +110,6 @@ LogType=W
 # LogFormat = 1
 # LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
 #
-# Examples for IIS (following two examples are equivalent):
-# LogFormat = 2
-# LogFormat = "%time2 %host %logname %method %url %code %bytesd %other %ua %referer"
-#
 LogFormat=1
 
 
@@ -155,9 +151,9 @@ SiteDomain=""
 # another site.
 # Note: Use space between each value.
 # Note: You can use regular expression values writing value with REGEX[value].
-# Example: "www.myserver.com localhost 127.0.0.1 REGEX[\.mydomain\.(net|org)$]"
+# Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]"
 #
-HostAliases="localhost 127.0.0.1 REGEX[^.*\.myserver\.com$]"
+HostAliases="localhost 127.0.0.1 REGEX[myserver\.com$]"
 
 
 # If you want to have hosts reported by name instead of ip address, AWStats
@@ -1261,8 +1257,7 @@ color_x="C1B2E2"                          # Background color for number of exit pages (Default = "C1B2
 # ExtraSectionNameX is title of your personalized chart.
 # ExtraSectionConditionalX are conditions you can use to count or not the hit,
 #   Use one of the field condition (URL, QUERY_STRING, REFERER, UA, HOST),
-#   and a regex to match after a coma. Use "|" for "OR". If you use several
-#   conditions, they will be combined as "AND".
+#   and a regex to match after a coma. Use "|" for "OR".
 # ExtraSectionFirstColumnTitleX is the first column title of the chart.
 # ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats in which 
 #   field to extract value from (URL, QUERY_STRING, REFERER, UA, HOST) and how
index f8635654e722335015153125890e47b736ddbabc..acd39d1dd293f3e9d8096834cba390fbc0c64d20 100644 (file)
@@ -337,7 +337,7 @@ use vars qw/ @Message /;
 'Day',
 'Month',
 'Year',
-'Statistics of',
+'Statistics for',
 'First visit',
 'Last visit',
 'Number of visits',
@@ -403,7 +403,7 @@ use vars qw/ @Message /;
 'Nov',
 'Dec',
 'Navigation',
-'Files type',
+'File type',
 'Update now',
 'Bandwidth',
 'Back to main page',
@@ -1628,7 +1628,7 @@ sub Check_Config {
        # Convert extra sections data into @ExtraConditionType, @ExtraConditionTypeVal...
        foreach my $extranum (1..@ExtraName-1) {
                my $part=0;
-               foreach my $conditioncouple (split(/\s\|\s/, $ExtraCondition[$extranum])) {
+               foreach my $conditioncouple (split(/\s*\|\s*/, $ExtraCondition[$extranum])) {
                        my ($conditiontype, $conditiontypeval)=split(/,/,$conditioncouple,2);
                        $ExtraConditionType[$extranum][$part]=$conditiontype;
                        if ($conditiontypeval =~ /^REGEX\[(.*)\]$/i) { $conditiontypeval=$1; }
@@ -1637,7 +1637,7 @@ sub Check_Config {
                        $part++;
                }
                $part=0;
-               foreach my $rowkeycouple (split(/\s\|\s/, $ExtraFirstColumnValues[$extranum])) {
+               foreach my $rowkeycouple (split(/\s*\|\s*/, $ExtraFirstColumnValues[$extranum])) {
                        my ($rowkeytype, $rowkeytypeval)=split(/,/,$rowkeycouple,2);
                        $ExtraFirstColumnValuesType[$extranum][$part]=$rowkeytype;
                        if ($rowkeytypeval =~ /^REGEX\[(.*)\]$/i) { $rowkeytypeval=$1; }
@@ -2375,7 +2375,7 @@ sub Read_History_With_TmpUpdate {
                                        chomp $_; s/\r//;
                                        @field=split(/\s+/,$_); $countlines++;
                                }
-                               until ($field[0] eq 'END_UNKOWNIP' || ! $_);
+                               until ($field[0] eq 'END_UNKNOWNIP' || ! $_);
                                if ($field[0] ne 'END_UNKNOWNIP') { error("History file \"$filetoread\" is corrupted (End of section UNKOWNIP not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
                                if ($Debug) { debug(" End of UNKOWNIP section ($count entries, $countloaded loaded)"); }
                                delete $SectionsToLoad{'visitor'};
@@ -4021,7 +4021,7 @@ sub Init_HashArray {
 # Return:              decodedstring
 #------------------------------------------------------------------------------
 sub ChangeWordSeparatorsIntoSpace {
-       $_[0] =~ s/%1[03]/ /g;                          # LF,CR
+       $_[0] =~ s/%0[ad]/ /ig;                         # LF,CR
        $_[0] =~ s/%2[02789abc]/ /ig;           # 
        $_[0] =~ s/%3a/ /ig;                            # :
        $_[0] =~ tr/\+\'\(\)\"\*,:/        /s;          # "&" and "=" must not be in this list
@@ -5618,7 +5618,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
        my $regnotnetscape=qr/gecko|compatible|opera|galeon|safari/i;
        my $regreferer=qr/^(\w+):\/\/([^\/:]+)(:\d+|)/;
        my $regreferernoquery=qr/^([^$URLQuerySeparators]+)/;
-       
+
        # Define value of $PerlParsingFormat and @fieldlib
        &DefinePerlParsingFormat();
 
@@ -9884,9 +9884,9 @@ if (scalar keys %HTMLOutput) {
                        if ($ExtraAddAverageRow[$extranum]) {
                                print "<tr>";
                                print "<td class=\"aws\"><b>$Message[96]</b></td>";
-                               if ($ExtraStatTypes[$extranum] =~ m/P/i) { print "<td>" . ($total_p/$count) . "</td>"; }
-                               if ($ExtraStatTypes[$extranum] =~ m/H/i) { print "<td>" . ($total_h/$count) . "</td>"; }
-                               if ($ExtraStatTypes[$extranum] =~ m/B/i) { print "<td>" . Format_Bytes(($total_k/$count)) . "</td>"; }
+                               if ($ExtraStatTypes[$extranum] =~ m/P/i) { print "<td>" . ($count?($total_p/$count):"&nbsp;") . "</td>"; }
+                               if ($ExtraStatTypes[$extranum] =~ m/H/i) { print "<td>" . ($count?($total_h/$count):"&nbsp;") . "</td>"; }
+                               if ($ExtraStatTypes[$extranum] =~ m/B/i) { print "<td>" . ($count?Format_Bytes($total_k/$count):"&nbsp;") . "</td>"; }
                                if ($ExtraStatTypes[$extranum] =~ m/L/i) { print "<td>&nbsp;</td>"; }
                                print "</tr>\n";
                        }