I modified the logwatch script in /etc/log.d/scripts/services/vpopmail to
give a count of successful login attempts instead of a line about each one:


near the beginning (under "# We don't care about these"):

} elsif (($ThisLine =~ /login success/)) {
     $LoginSuccess++;

and at the end of the file:

if ($LoginSuccess) {
  print "\nSuccessful logins: ". $LoginSuccess."\n";
}


This is what i did to the vpopmail file:-

# We don't care about these
} elsif (($ThisLine =~ /login success/)) {
$LoginSuccess++;
} elsif (($VirtAccount) = ($ThisLine =~ /no virt found (.*?)\:/i )) {
$NoAccount{$VirtAccount}++;
} elsif (($ThisLine =~ /bounce msg/)) {
$Bounce++;
} elsif (($Email) = ($ThisLine =~ /password fail (.*?)\:/i )) {
$PasswordFail{$Email}++;
} elsif ((undef, $NoUser) = ($ThisLine =~ /(no user found|user not found) (.*?)\:/i )) {
$NoUserFound{$NoUser}++;
} else {
# Report any unmatched entries...
push @OtherList,$ThisLine;
}
}


And i got :-

[EMAIL PROTECTED] services]# ./vpopmail
syntax error at ./vpopmail line 16, near ")
     # We don't care about these
  }"
Execution of ./vpopmail aborted due to compilation errors.

Can someone enlighten me. Thanks



Reply via email to