|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/share/logwatch/scripts/services/ |
Upload File : |
##########################################################################
# $Id: qmail-smtpd,v 1.6 2005/12/17 15:45:42 bjorn Exp $
##########################################################################
# $Log: qmail-smtpd,v $
# Revision 1.6 2005/12/17 15:45:42 bjorn
# Fixed error in rblsmtpd lines, by Bob Hutchinson
#
# Revision 1.5 2005/10/19 05:31:29 bjorn
# Fixes to report headings, by Bob Hutchinson
#
# Revision 1.4 2005/10/06 23:37:46 mike
# Added #vi tag -mgt
#
# Revision 1.3 2005/09/27 21:20:28 bjorn
# Quarantine support, by Bob Hutchinson
#
# Revision 1.2 2005/09/07 15:20:21 bjorn
# Added badmailfrom/badmailto, by Bob Hutchinson
#
# Revision 1.1 2005/09/07 00:37:59 bjorn
# New qmail multilog files written by Bob Hutchinson
#
##########################################################################
$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'};
$QmailDetail = $ENV{'qmail_high_detail'};
$QmailThreshold = ($ENV{'threshold'} ? $ENV{'threshold'} : 0 );
$ToThreshold = $ENV{'to_threshold'};
$FromThreshold = $ENV{'from_threshold'};
$BlockedThreshold = $ENV{'blocked_threshold'};
# simscan
$SimscanThreshold = $ENV{'simscan_threshold'};
$SimscanFromThreshold = $ENV{'simscan_from_threshold'};
$SimscanToThreshold = $ENV{'simscan_to_threshold'};
$SimscanAttachThreshold = $ENV{'simscan_attach_threshold'};
# chkuser
$ChkuserRejectsFromThreshold = $ENV{'chkuser_rejects_from_threshold'};
$ChkuserRejectsToThreshold = $ENV{'chkuser_rejects_to_threshold'};
$ChkuserRejectsRemoteThreshold = $ENV{'chkuser_rejects_remote_threshold'};
$ChkuserRejectsReasonThreshold = $ENV{'chkuser_rejects_reason_threshold'};
$ChkuserRejectsRelayFromThreshold = $ENV{'chkuser_rejects_relay_from_threshold'};
$ChkuserRejectsRelayToThreshold = $ENV{'chkuser_rejects_relay_to_threshold'};
$ChkuserRejectsRelayRemoteThreshold = $ENV{'chkuser_rejects_relay_remote_threshold'};
$ChkuserAcceptsFromThreshold = $ENV{'chkuser_accepts_from_threshold'};
$ChkuserAcceptsToThreshold = $ENV{'chkuser_accepts_to_threshold'};
$ChkuserAcceptsRelayFromThreshold = $ENV{'chkuser_accepts_relay_from_threshold'};
$ChkuserAcceptsRelayToThreshold = $ENV{'chkuser_accepts_relay_to_threshold'};
$ChkuserNoAuthResourceThreshold = $ENV{'chkuser_noauthresource_threshold'};
$ChkuserOverquotaThreshold = $ENV{'chkuser_overquota_threshold'};
$ChkuserRejectedIntrusionThreshold = $ENV{'chkuser_rejected_intrusion_threshold'};
$BadMailToIpThreshold = $ENV{'badmailto_ip_threshold'};
$BadMailToEmailThreshold = $ENV{'badmailto_email_threshold'};
$BadMailFromIpThreshold = $ENV{'badmailfrom_ip_threshold'};
$BadMailFromEmailThreshold = $ENV{'badmailfrom_email_threshold'};
$IgnoreUnmatched = $ENV{'ignoreunmatched'};
while (defined($ThisLine = <STDIN>)) {
if ( ( $ThisLine =~ /status: / )
or ( $ThisLine =~ /end (\d+) status \d+/ )
or ( $ThisLine =~ /simscan: Putting the message in quarantine/ )
) {
# We don't care about these
}
elsif ( ($pid1, $RemoteServer) = ( $ThisLine =~ /pid (\d+) from (.*)/ ) ) {
$From{$RemoteServer}++;
$TotalFrom++;
$GrandTotalFrom++;
}
elsif ( ($pid2,$LocalServer,$rest) = ( $ThisLine =~ /ok (\d+) \d+:(.*):25\s+(.*)/ ) ) {
$To{$LocalServer}++;
$TotalTo++;
$Total++;
if ( $rest !~ /^\:/) {
# we have a domain
($d, $ip ) = ($rest =~ /^(.*):(.*)::\d+$/);
$Domains{$ip} = $d;
}
}
elsif ( ($Warning) = ( $ThisLine =~ /warning: (.*)/i ) ) {
$Warnings{$Warning}++;
}
# rblsmtpd
elsif ( ($Blocked, $pid3, $rbl) = ( $ThisLine =~ /rblsmtpd: (.*) pid (\d+).*: 451\s+(.*)$/ ) ) {
$Blockeds{$Blocked}++;
$TotalBlocked++;
$Rbl{$Blocked} = $rbl;
# remove it from previous parse
if ( defined( $From{$Blocked} ) ) {
$From{$Blocked}--;
$TotalFrom--;
}
}
# CHKUSER rejected rcpt
elsif (($from, $remote, $to, $reason) = ( $ThisLine =~ /CHKUSER rejected rcpt: from <(.*):.*:> remote <.*:.*:(.*)> rcpt <(.*)> : (.*)/ )) {
$ChkuserRejectsFrom{$from}++;
$ChkuserRejectsRemote{$remote}++;
$ChkuserRejectsTo{$to}++;
$ChkuserRejectsReason{$reason}++;
$TotalReject++;
# remove it from previous parse
if ( defined( $From{$from} ) ) {
$From{$from}--;
$TotalFrom--;
}
}
# CHKUSER rejected relaying
elsif (($from, $remote, $to, $reason) = ( $ThisLine =~ /CHKUSER rejected relaying: from <(.*):.*:> remote <.*:.*:(.*)> rcpt <(.*)> : (.*)/ )) {
$ChkuserRejectsRelayFrom{$from}++;
$ChkuserRejectsRelayTo{$to}++;
$ChkuserRejectsRelayRemote{$remote}++;
$ChkuserRejectsReason{$reason}++;
$TotalRejectRelay++;
# remove it from previous parse
if ( defined( $From{$from} ) ) {
$From{$from}--;
$TotalFrom--;
}
}
# CHKUSER accepted rcpt
elsif (($from, $to) = ( $ThisLine =~ /CHKUSER accepted rcpt: from <(.*):.*:> .* rcpt <(.*)> : found existing recipient/ )) {
$ChkuserAcceptsFrom{$from}++;
$ChkuserAcceptsTo{$to}++;
$TotalAccept++;
}
# CHKUSER relaying rcpt
elsif (($from, $to) = ( $ThisLine =~ /CHKUSER relaying rcpt: from <(.*):.*:> .* rcpt <(.*)> : client allowed to relay/ )) {
$ChkuserAcceptsRelayFrom{$from}++;
$ChkuserAcceptsRelayTo{$to}++;
$TotalAcceptRelay++;
}
# CHKUSER no auth resource
elsif (($from, $to) = ( $ThisLine =~ /CHKUSER no auth resource: from <(.*):.*:> .* rcpt <(.*)> :/ )) {
$ChkuserNoAuthResourceFrom{$from}++;
$ChkuserNoAuthResourceTo{$to}++;
$TotalNoAuthResource++;
# remove it from previous parse
if ( defined( $From{$from} ) ) {
$From{$from}--;
$TotalFrom--;
}
}
# CHKUSER mbx overquota
elsif (($from, $to) = ( $ThisLine =~ /CHKUSER mbx overquota: from <(.*):.*:> .* rcpt <(.*)> :/ )) {
$ChkuserOverquotaTo{$to}++;
$TotalOverquota++;
# remove it from previous parse
if ( defined( $From{$from} ) ) {
$From{$from}--;
$TotalFrom--;
}
}
# CHKUSER rejected intrusion
elsif (($from, $to) = ( $ThisLine =~ /CHKUSER rejected intrusion: from <(.*):.*:> .* rcpt <(.*)> :/ )) {
$ChkuserRejectedIntrusionFrom{$from}++;
$ChkuserRejectedIntrusionTo{$to}++;
$TotalRejectedIntrusion++;
# remove it from previous parse
if ( defined( $From{$from} ) ) {
$From{$from}--;
$TotalFrom--;
}
}
# simscan virus
elsif ( ($virus, $virusfrom, $virusto, $scantime) = ($ThisLine =~ /simscan:.*virus: (.*) from: (.*) to: (.*) time: (.*)s/)) {
$Simscan{$virus}++;
$SimscanTotal++;
$SimscanFrom{$virusfrom}++;
$SimscanTo{$virusto}++;
if ($Maxscantime < $scantime) {
$Maxscantime = $scantime;
}
}
# simscan attach
elsif ( ($attach, $attachfrom, $attachto, $scantime) = ($ThisLine =~ /simscan:.*invalid attachment: (.*) from: (.*) to: (.*) time: (.*)s/) ) {
$SimscanAttach{$attach}++;
$SimscanAttachFrom{$attachfrom}++;
$SimscanAttachTo{$attachto}++;
$SimscanAttachTotal++;
if ($Maxscantime < $scantime) {
$Maxscantime = $scantime;
}
}
# simscan quarantine
elsif ( $ThisLine =~ /simscan: Message recorded in quarantine/ ) {
$Quarantine++;
}
# badmailfrom
elsif ( ($email,$ip) = ($ThisLine =~ /qmail-smtpd: badmailfrom: (.*) at (.*)/) ) {
$Badmailfromemail{$email}++;
$Badmailfromip{$ip}++;
$Badmailfromtot++;
}
# badmailto
elsif ( ($email,$ip) = ($ThisLine =~ /qmail-smtpd: badmailto: (.*) at (.*)/) ) {
$Badmailtoemail{$email}++;
$Badmailtoip{$ip}++;
$Badmailtotot++;
}
else {
# Report any unmatched entries...
push @OtherList,$ThisLine;
}
}
if ($QmailDetail >= 1) {
if (($FromThreshold < 0) or ($FromThreshold eq '')) {
$FromThreshold = $QmailThreshold;
}
if (($ToThreshold < 0) or ($ToThreshold eq '')) {
$ToThreshold = $QmailThreshold;
}
if (($BlockedThreshold < 0) or ($BlockedThreshold eq '')) {
$BlockedThreshold = $QmailThreshold;
}
if (($SimscanThreshold < 0) or ($SimscanThreshold eq '')) {
$SimscanThreshold = $QmailThreshold;
}
if (($SimscanFromThreshold < 0) or ($SimscanFromThreshold eq '')) {
$SimscanFromThreshold = $QmailThreshold;
}
if (($SimscanToThreshold < 0) or ($SimscanToThreshold eq '')) {
$SimscanToThreshold = $QmailThreshold;
}
if (($SimscanAttachThreshold < 0) or ($SimscanAttachThreshold eq '')) {
$SimscanAttachThreshold = $QmailThreshold;
}
if (($ChkuserRejectsFromThreshold < 0) or ($ChkuserRejectsFromThreshold eq '')) {
$ChkuserRejectsFromThreshold = $QmailThreshold;
}
if (($ChkuserRejectsToThreshold < 0) or ($ChkuserRejectsToThreshold eq '')) {
$ChkuserRejectsToThreshold = $QmailThreshold;
}
if (($ChkuserRejectsRemoteThreshold < 0) or ($ChkuserRejectsRemoteThreshold eq '')) {
$ChkuserRejectsRemoteThreshold = $QmailThreshold;
}
if (($ChkuserRejectsRelayFromThreshold < 0) or ($ChkuserRejectsRelayFromThreshold eq '')) {
$ChkuserRejectsRelayFromThreshold = $QmailThreshold;
}
if (($ChkuserRejectsRelayToThreshold < 0) or ($ChkuserRejectsRelayToThreshold eq '')) {
$ChkuserRejectsRelayToThreshold = $QmailThreshold;
}
if (($ChkuserRejectsRelayRemoteThreshold < 0) or ($ChkuserRejectsRelayRemoteThreshold eq '')) {
$ChkuserRejectsRelayRemoteThreshold = $QmailThreshold;
}
if (($ChkuserRejectsReasonThreshold < 0) or ($ChkuserRejectsReasonThreshold eq '')) {
$ChkuserRejectsReasonThreshold = $QmailThreshold;
}
if (($ChkuserAcceptsFromThreshold < 0) or ($ChkuserAcceptsFromThreshold eq '')) {
$ChkuserAcceptsFromThreshold = $QmailThreshold;
}
if (($ChkuserAcceptsToThreshold < 0) or ($ChkuserAcceptsToThreshold eq '')) {
$ChkuserAcceptsToThreshold = $QmailThreshold;
}
if (($ChkuserAcceptsRelayFromThreshold < 0) or ($ChkuserAcceptsRelayFromThreshold eq '')) {
$ChkuserAcceptsRelayFromThreshold = $QmailThreshold;
}
if (($ChkuserAcceptsRelayToThreshold < 0) or ($ChkuserAcceptsRelayToThreshold eq '')) {
$ChkuserAcceptsRelayToThreshold = $QmailThreshold;
}
if (($ChkuserNoAuthResourceThreshold < 0) or ($ChkuserNoAuthResourceThreshold eq '')) {
$ChkuserNoAuthResourceThreshold = $QmailThreshold;
}
if (($ChkuserOverquotaThreshold < 0) or ($ChkuserOverquotaThreshold eq '')) {
$ChkuserOverquotaThreshold = $QmailThreshold;
}
if (($ChkuserRejectedIntrusionThreshold <0) or ($ChkuserRejectedIntrusionThreshold eq '')) {
$ChkuserRejectedIntrusionThreshold = $QmailThreshold;
}
if (($BadMailToIpThreshold <0) or ($BadMailToIpThreshold eq '')) {
$BadMailToIpThreshold = $QmailThreshold;
}
if (($BadMailToEmailThreshold <0) or ($BadMailToEmailThreshold eq '')) {
$BadMailToEmailThreshold = $QmailThreshold;
}
if (($BadMailFromIpThreshold <0) or ($BadMailFromIpThreshold eq '')) {
$BadMailFromIpThreshold = $QmailThreshold;
}
if (($BadMailFromEmailThreshold <0) or ($BadMailFromEmailThreshold eq '')) {
$BadMailFromEmailThreshold = $QmailThreshold;
}
# start output
if ( (keys %From) ) {
print "\nConnections from (Threshold of " . $FromThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$From{$b} <=> $From{$a}} keys %From) {
if ($From{$Line} >= $FromThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $From{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $From{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %To) ) {
print "\nConnections to (Threshold of " . $ToThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$To{$b} <=> $To{$a}} keys %To) {
if ($To{$Line} >= $ToThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $To{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $To{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %Blockeds) ) {
print "\nBlocked (Threshold of " . $BlockedThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$Blockeds{$b} <=> $Blockeds{$a}} keys %Blockeds) {
if ($Blockeds{$Line} >= $BlockedThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $Blockeds{$Line} . " Time(s)" . ($Rbl{$Line} ? " By ".$Rbl{$Line} : "") . "\n";
}
else {
print "\t" . $Line . " - ". $Blockeds{$Line} . " Time(s)" . ($Rbl{$Line} ? " By ".$Rbl{$Line} : "") . "\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# chkuser
if ( (keys %ChkuserRejectsFrom) ) {
print "\nChkuser Rejects From (Threshold of " . $ChkuserRejectsFromThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsFrom{$b} <=> $ChkuserRejectsFrom{$a}} keys %ChkuserRejectsFrom) {
if ($ChkuserRejectsFrom{$Line} >= $ChkuserRejectsFromThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectsTo) ) {
print "\nChkuser Rejects To (Threshold of " . $ChkuserRejectsToThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsTo{$b} <=> $ChkuserRejectsTo{$a}} keys %ChkuserRejectsTo) {
if ($ChkuserRejectsTo{$Line} >= $ChkuserRejectsToThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectsRemote) ) {
print "\nChkuser Rejects Remote (Threshold of " . $ChkuserRejectsRemoteThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsRemote{$b} <=> $ChkuserRejectsRemote{$a}} keys %ChkuserRejectsRemote) {
if ($ChkuserRejectsRemote{$Line} >= $ChkuserRejectsRemoteThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsRemote{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsRemote{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectsRelayFrom) ) {
print "\nChkuser Rejects Relay From (Threshold of " . $ChkuserRejectsRelayFromThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsRelayFrom{$b} <=> $ChkuserRejectsRelayFrom{$a}} keys %ChkuserRejectsRelayFrom) {
if ($ChkuserRejectsRelayFrom{$Line} >= $ChkuserRejectsRelayFromThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsRelayFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsRelayFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectsRelayTo) ) {
print "\nChkuser Rejects Relay To (Threshold of " . $ChkuserRejectsRelayToThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsRelayTo{$b} <=> $ChkuserRejectsRelayTo{$a}} keys %ChkuserRejectsRelayTo) {
if ($ChkuserRejectsRelayTo{$Line} >= $ChkuserRejectsRelayToThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsRelayTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsRelayTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectsRelayRemote) ) {
print "\nChkuser Rejects Relay Remote (Threshold of " . $ChkuserRejectsRelayRemoteThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsRelayRemote{$b} <=> $ChkuserRejectsRelayRemote{$a}} keys %ChkuserRejectsRelayRemote) {
if ($ChkuserRejectsRelayRemote{$Line} >= $ChkuserRejectsRelayRemoteThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsRelayRemote{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsRelayRemote{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectsReason) ) {
print "\nChkuser Rejects Reason (Threshold of " . $ChkuserRejectsReasonThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectsReason{$b} <=> $ChkuserRejectsReason{$a}} keys %ChkuserRejectsReason) {
if ($ChkuserRejectsReason{$Line} >= $ChkuserRejectsReasonThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectsReason{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectsReason{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserAcceptsFrom) ) {
print "\nChkuser Accepts from (Threshold of " . $ChkuserAcceptsFromThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserAcceptsFrom{$b} <=> $ChkuserAcceptsFrom{$a}} keys %ChkuserAcceptsFrom) {
if ($ChkuserAcceptsFrom{$Line} >= $ChkuserAcceptsFromThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserAcceptsFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserAcceptsFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserAcceptsTo) ) {
print "\nChkuser Accepts to (Threshold of " . $ChkuserAcceptsToThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserAcceptsTo{$b} <=> $ChkuserAcceptsTo{$a}} keys %ChkuserAcceptsTo) {
if ($ChkuserAcceptsTo{$Line} >= $ChkuserAcceptsToThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserAcceptsTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserAcceptsTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserAcceptsRelayFrom) ) {
print "\nChkuser Accepts Relay from (Threshold of " . $ChkuserAcceptsRelayFromThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserAcceptsRelayFrom{$b} <=> $ChkuserAcceptsRelayFrom{$a}} keys %ChkuserAcceptsRelayFrom) {
if ($ChkuserAcceptsRelayFrom{$Line} >= $ChkuserAcceptsRelayFromThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserAcceptsRelayFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserAcceptsRelayFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserAcceptsRelayTo) ) {
print "\nChkuser Accepts Relay to (Threshold of " . $ChkuserAcceptsRelayToThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserAcceptsRelayTo{$b} <=> $ChkuserAcceptsRelayTo{$a}} keys %ChkuserAcceptsRelayTo) {
if ($ChkuserAcceptsRelayTo{$Line} >= $ChkuserAcceptsRelayToThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserAcceptsRelayTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserAcceptsRelayTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserNoAuthResourceFrom) ) {
print "\nChkuser No Auth Resource from (Threshold of " . $ChkuserNoAuthResourceThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserNoAuthResourceFrom{$b} <=> $ChkuserNoAuthResourceFrom{$a}} keys %ChkuserNoAuthResourceFrom) {
if ($ChkuserNoAuthResourceFrom{$Line} >= $ChkuserNoAuthResourceThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserNoAuthResourceFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserNoAuthResourceFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserNoAuthResourceTo) ) {
print "\nChkuser No Auth resource to (Threshold of " . $ChkuserNoAuthResourceThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserNoAuthResourceTo{$b} <=> $ChkuserNoAuthResourceTo{$a}} keys %ChkuserNoAuthResourceTo) {
if ($ChkuserNoAuthResourceTo{$Line} >= $ChkuserNoAuthResourceThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserNoAuthResourceTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserNoAuthResourceTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserOverquotaTo) ) {
print "\nChkuser Over Quota (Threshold of " . $ChkuserOverquotaThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserOverquotaTo{$b} <=> $ChkuserOverquotaTo{$a}} keys %ChkuserOverquotaTo) {
if ($ChkuserOverquotaTo{$Line} >= $ChkuserOverquotaThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserOverquotaTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserOverquotaTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectedIntrusionFrom) ) {
print "\nChkuser Rejected Intrusions from (Threshold of " . $ChkuserRejectedIntrusionThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectedIntrusionFrom{$b} <=> $ChkuserRejectedIntrusionFrom{$a}} keys %ChkuserRejectedIntrusionFrom) {
if ($ChkuserRejectedIntrusionFrom{$Line} >= $ChkuserRejectedIntrusionThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectedIntrusionFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectedIntrusionFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( (keys %ChkuserRejectedIntrusionTo) ) {
print "\nChkuser Rejected Intrusions to (Threshold of " . $ChkuserRejectedIntrusionThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$ChkuserRejectedIntrusionTo{$b} <=> $ChkuserRejectedIntrusionTo{$a}} keys %ChkuserRejectedIntrusionTo) {
if ($ChkuserRejectedIntrusionTo{$Line} >= $ChkuserRejectedIntrusionThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $ChkuserRejectedIntrusionTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $ChkuserRejectedIntrusionTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan
if ( (keys %Simscan) ) {
print "\nSimscan Viruses (Threshold of " . $SimscanThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$Simscan{$b} <=> $Simscan{$a}} keys %Simscan) {
if ($Simscan{$Line} >= $SimscanThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $Simscan{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $Simscan{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan from
if ( (keys %SimscanFrom) ) {
print "\nSimscan Viruses From (Threshold of " . $SimscanFromThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$SimscanFrom{$b} <=> $SimscanFrom{$a}} keys %SimscanFrom) {
if ($SimscanFrom{$Line} >= $SimscanFromThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $SimscanFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $SimscanFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan to
if ( (keys %SimscanTo) ) {
print "\nSimscan Viruses To (Threshold of " . $SimscanToThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$SimscanTo{$b} <=> $SimscanTo{$a}} keys %SimscanTo) {
if ($SimscanTo{$Line} >= $SimscanToThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $SimscanTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $SimscanTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan attach
if ( (keys %SimscanAttach) ) {
print "\nSimscan Attachments (Threshold of " . $SimscanAttachThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$SimscanAttach{$b} <=> $SimscanAttach{$a}} keys %SimscanAttach) {
if ($SimscanAttach{$Line} >= $SimscanAttachThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $SimscanAttach{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $SimscanAttach{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan attach from
if ( (keys %SimscanAttachFrom) ) {
print "\nSimscan Attachments From (Threshold of " . $SimscanAttachThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$SimscanAttachFrom{$b} <=> $SimscanAttachFrom{$a}} keys %SimscanAttachFrom) {
if ($SimscanAttachFrom{$Line} >= $SimscanAttachThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $SimscanAttachFrom{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $SimscanAttachFrom{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan attach to
if ( (keys %SimscanAttachTo) ) {
print "\nSimscan Attachments To (Threshold of " . $SimscanAttachThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$SimscanAttachTo{$b} <=> $SimscanAttachTo{$a}} keys %SimscanAttachTo) {
if ($SimscanAttachTo{$Line} >= $SimscanAttachThreshold) {
$threshold_reached=1;
if ($Domains{$Line}) {
print "\t" . $Domains{$Line} . " [$Line] - ". $SimscanAttachTo{$Line} . " Time(s)\n";
}
else {
print "\t" . $Line . " - ". $SimscanAttachTo{$Line} . " Time(s)\n";
}
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
# simscan quarantine
if ( $Quarantine ) {
print "\nSimscan Quarantine: $Quarantine emails\n";
}
# qmail-smtpd reports
if ( keys %Badmailfromemail) {
print "\nEmails caught by badmailfrom by email (Threshold of " . $BadMailFromEmailThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$Badmailfromemail{$b} <=> $Badmailfromemail{$a}} keys %Badmailfromemail) {
if ($Badmailfromemail{$Line} >= $BadMailFromEmailThreshold) {
$threshold_reached=1;
print "\t" . $Line . " - ". $Badmailfromemail{$Line} . " Time(s)\n";
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( keys %Badmailfromip) {
print "\nEmails caught by badmailfrom by ip: (Threshold of " . $BadMailFromIpThreshold . ")\n";
$threshold_reached=0;
foreach $Line (sort {$Badmailfromip{$b} <=> $Badmailfromip{$a}} keys %Badmailfromip) {
if ($Badmailfromip{$Line} >= $BadMailFromIpThreshold) {
$threshold_reached=1;
print "\t" . $Line . " - ". $Badmailfromip{$Line} . " Time(s)\n";
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( keys %Badmailtoemail) {
print "\nEmails caught by badmailto by email (Threshold of " . $BadMailToEmailThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$Badmailtoemail{$b} <=> $Badmailtoemail{$a}} keys %Badmailtoemail) {
if ($Badmailtoemail{$Line} >= $BadMailToEmailThreshold) {
$threshold_reached=1;
print "\t" . $Line . " - ". $Badmailtoemail{$Line} . " Time(s)\n";
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
if ( keys %Badmailtoip) {
print "\nEmails caught by badmailto by ip (Threshold of " . $BadMailToIpThreshold . "):\n";
$threshold_reached=0;
foreach $Line (sort {$Badmailtoip{$b} <=> $Badmailtoip{$a}} keys %Badmailtoip) {
if ($Badmailtoip{$Line} >= $BadMailToIpThreshold) {
$threshold_reached=1;
print "\t" . $Line . " - ". $Badmailtoip{$Line} . " Time(s)\n";
}
}
if ($threshold_reached < 1) {
print "\t" . "None found above the threshold\n";
}
}
#
}
# end high detail
# show totals
if ($TotalFrom or $TotalTo) {
print "\nTotals:\n";
print "\tRemote connections: $TotalFrom\n";
print "\t Local connections: $TotalTo\n";
}
if ($TotalBlocked) {
print "\t RBL blocked: $TotalBlocked\n";
print "\t Grand Total From: $GrandTotalFrom\n";
printf("\tPercentage blocked: %2.3f",(($TotalBlocked/$GrandTotalFrom)*100));
print " %\n";
}
if ($TotalReject or $TotalAccept) {
print "\nChkuser Totals:\n";
print "\tRejected: $TotalReject\n";
print "\tAccepted: $TotalAccept\n";
}
if ($TotalAcceptRelay) {
print "\nTotal accepted relays: $TotalAcceptRelay\n";
}
if ($TotalRejectRelay) {
print "\nTotal rejected relays: $TotalRejectRelay\n";
}
if ($TotalNoAuthResource) {
print "\nTotal No Auth Resources: $TotalNoAuthResource\n";
}
if ($TotalOverquota) {
print "\nTotal Over quota: $TotalOverquota\n";
}
if ($TotalRejectedIntrusion) {
print "\nTotal Rejected Intrusions: $TotalRejectedIntrusion\n";
}
if ($SimscanTotal) {
print "\nSimscan Total: $SimscanTotal\n";
print "Maximum Scanning Time: $Maxscantime\n";
}
if ($Badmailtotot) {
print "\nTotal badmailto: $Badmailtotot\n";
}
if ($Badmailfromtot) {
print "\nTotal badmailfrom: $Badmailfromtot\n";
}
if ($Total) {
print "\nTotal mail: $Total\n";
}
# warnings
if ( (keys %Warnings) ) {
print "\nWarnings:\n";
foreach $Line (sort {$Warnings{$b} <=> $Warnings{$a}} keys %Warnings) {
print "\t" . $Line . " - ". $Warnings{$Line} . " Time(s)\n";
}
}
# other
if (($#OtherList >= 0) and (! $IgnoreUnmatched)) {
print "\n**Unmatched Entries**\n";
print @OtherList;
}
exit(0);
# vi: shiftwidth=3 tabstop=3 syntax=perl et