# %email EMail sender (for mail log)
# %email_r EMail receiver (for mail log)
# %virtualname Web sever virtual hostname. Use this tag when same log
-# file contains data of several virtual web servers. The
-# SiteDomain will be used to filter the one you want.
+# contains data of several virtual web servers. AWStats
+# will discard records not in SiteDomain nor HostAliases
# If your log format has some fields not included in this list, use
# %other Means another field not used
#
push @INC, "$dir";
$DirAddedInINC{"$dir"}=1;
}
- #my $loadret=require "$FilePath{$file}";
- my $loadret=(require "$FilePath{$file}"||require "${file}");
+ my $loadret=require "$file";
+ #my $loadret=(require "$FilePath{$file}"||require "${file}");
}
}
}
$DirAddedInINC{"$dir"}=1;
}
#my $loadret=require "$pluginpath";
- my $loadret=(require "$pluginpath"||require "${pluginfile}.pm");
+ my $loadret=require "${pluginfile}.pm";
+ #my $loadret=(require "$pluginpath"||require "${pluginfile}.pm");
if (! $loadret || $loadret =~ /^error/i) {
# Load failed, we stop here
}
#--------------------------------------------------------------------
-# Function: Tell if an email is an local or external email
+# Function: Tell if an email is a local or external email
# Parameters: email
-# Input: $SiteDomain $HostAliases
+# Input: $SiteDomain(exact string) $HostAliases(quoted regex string)
# Output: None
# Return: -1, 0 or 1
#--------------------------------------------------------------------
my $email=shift||'unknown';
if ($email !~ /\@(.*)$/) { return 0; }
my $domain=$1;
- if ($domain eq $SiteDomain) { return 1; }
+ if ($domain =~ /^$SiteDomain$/i) { return 1; }
foreach my $match (@HostAliases) { if ($domain =~ /$match/i) { return 1; } }
return -1;
}
print "<A HREF=\"$newkey\" target=\"url\">$nompage</A>";
}
elsif ($newkey =~ /^\//) { # URL seems to be an url extracted from a web or wap server log file
- $newkey =~ s/^\/$SiteDomain//;
+ $newkey =~ s/^\/$SiteDomain//i;
# Define urlprot
my $urlprot='http';
if ($UseHTTPSLinkForUrl && $newkey =~ /^$UseHTTPSLinkForUrl/) { $urlprot='https'; }
# Check virtual host name
#----------------------------------------------------------------------
- if ($pos_vh>=0 && $field[$pos_vh] ne $SiteDomain) {
+ if ($pos_vh>=0 && $field[$pos_vh] !~ /^$SiteDomain$/i) {
my $skip=1;\r
foreach my $key (@HostAliases) {\r
- if ($field[$pos_vh] =~ m/^$key$/) { $skip=0; next; }\r
+ if ($field[$pos_vh] =~ m/$key$/i) { $skip=0; next; }\r
}\r
if ($skip) {\r
$NbOfLinesDropped++;\r