my $HOME="/home/lace";
my $Mail="$HOME/Mail";
my @ValidUsers=qw(root lace short kratochvil _local);
-my $IdleMax=120;
+my $IdleMax=10;
my $MaxBodySMS=0x1000; # max bytes to pass to Lingua::EN::Squeeze
my $SMSmailError='short+err@ucw.cz';
my @SMSwebRcpt=qw(420 602 431329);
my $SMScontact='<short@ucw.cz>';
our($Message,$Audit,@AuditStored,$store_ignore,$store_ignorenewmail,$store_profile,$DoBell);
-our(%audit_profile,@sms_squeezes,@alternates_host); # imported
+our(%audit_profile,@sms_squeezes,@alternates_host,@dnsbl_whitelist); # imported
my %alternates_host; # from @alternates_host
+my %dnsbl_whitelist; # from @dnsbl_whitelist
# from RedHat "procmail-3.22-5"
# /i should be only $procmailFROM_DAEMON but how it can hurt to /i all?
sub useridle
{
- return 0 if ! -e $ENV{"HOME"}."/idle";
+ return 0 if ! -e "$HOME/away";
my %valid_users=map(($_=>1),@ValidUsers);
my($idlebest,$linebest);
for my $utmp (User::Utmp::getut(),{ "ut_line"=>"psaux" }) {
return @r;
}
-my %dnsbl_whitelist=map(($_=>1),(
- "195.250.128.83" # smtp3.vol.cz; 83.128.250.195.blackholes.five-ten-sg.com
- ));
-
# Extended Mail::Audit::MAPS
# $domain,$full,[$timeout]
sub dnsbl
$timeout||=30; # sec
$Mail::Audit::MAPS::host=$domain;
my @hosts=map({ s/^.*://; "[$_]"; } # strip DNS part
- grep({ /^([^:@]*):/ && !$alternates_host{$1} # leave only foreign hosts
- && !$dnsbl_whitelist{$1}; } (Received_for()))
+ grep({ /^([^:@]*):/ # $1 is DNS name, $' is IP address
+ && !$alternates_host{$1} # leave only foreign hosts
+ && !$dnsbl_whitelist{$'}; } (Received_for()))
);
splice @hosts,1 if !$full && @hosts; # "&& @hosts" to prevent: WARN: splice() offset past end of array
{
eval <AUDIT> or die "eval \"$filenameMyAudit\": $@";
audit_init();
%alternates_host=map((lc($_)=>1),@alternates_host);
+ %dnsbl_whitelist=map(( $_ =>1),@dnsbl_whitelist);
}
close AUDIT or warn "close \"$filenameMyAudit\": $!";