Fix all uses of warn() to be $self->log(LOGWARN, ...)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@380 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
db546fe91c
commit
43aa207242
@ -42,7 +42,7 @@ sub mail_handler {
|
|||||||
$bad =~ s/^\s*(\S+).*/$1/;
|
$bad =~ s/^\s*(\S+).*/$1/;
|
||||||
next unless $bad;
|
next unless $bad;
|
||||||
$bad = lc $bad;
|
$bad = lc $bad;
|
||||||
warn "Bad badmailfrom config: No \@ sign in $bad\n" and next unless $bad =~ m/\@/;
|
$self->log(LOGWARN, "Bad badmailfrom config: No \@ sign in $bad") and next unless $bad =~ m/\@/;
|
||||||
$transaction->notes('badmailfrom', "sorry, your envelope sender is in my badmailfrom list")
|
$transaction->notes('badmailfrom', "sorry, your envelope sender is in my badmailfrom list")
|
||||||
if ($bad eq $from) || (substr($bad,0,1) eq '@' && $bad eq "\@$host");
|
if ($bad eq $from) || (substr($bad,0,1) eq '@' && $bad eq "\@$host");
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ sub mail_handler {
|
|||||||
$bad =~ s/^\s*(\S+).*/$1/;
|
$bad =~ s/^\s*(\S+).*/$1/;
|
||||||
next unless $bad;
|
next unless $bad;
|
||||||
$bad = lc $bad;
|
$bad = lc $bad;
|
||||||
warn "Bad badmailfromto config: No \@ sign in $bad\n" and next unless $bad =~ m/\@/;
|
$self->log(LOGWARN, "Bad badmailfromto config: No \@ sign in $bad") and next unless $bad =~ m/\@/;
|
||||||
$transaction->notes('badmailfromto', "$bad")
|
$transaction->notes('badmailfromto', "$bad")
|
||||||
if ($bad eq $from)
|
if ($bad eq $from)
|
||||||
|| (substr($bad,0,1) eq '@' && $bad eq "\@$host");
|
|| (substr($bad,0,1) eq '@' && $bad eq "\@$host");
|
||||||
|
@ -43,7 +43,7 @@ sub check_dns {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
warn "$$ query for $host failed: ", $res->errorstring, "\n"
|
$self->log(LOGWARN, "$$ query for $host failed: ", $res->errorstring)
|
||||||
unless $res->errorstring eq "NXDOMAIN";
|
unless $res->errorstring eq "NXDOMAIN";
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -138,18 +138,18 @@ sub check_spam {
|
|||||||
# or CHECK or REPORT or SYMBOLS
|
# or CHECK or REPORT or SYMBOLS
|
||||||
|
|
||||||
print SPAMD "X-Envelope-From: ", $transaction->sender->format, CRLF
|
print SPAMD "X-Envelope-From: ", $transaction->sender->format, CRLF
|
||||||
or warn "Could not print to spamd: $!";
|
or $self->log(LOGWARN, "Could not print to spamd: $!");
|
||||||
|
|
||||||
print SPAMD join CRLF, split /\n/, $transaction->header->as_string
|
print SPAMD join CRLF, split /\n/, $transaction->header->as_string
|
||||||
or warn "Could not print to spamd: $!";
|
or $self->log(LOGWARN, "Could not print to spamd: $!");
|
||||||
|
|
||||||
print SPAMD CRLF
|
print SPAMD CRLF
|
||||||
or warn "Could not print to spamd: $!";
|
or $self->log(LOGWARN, "Could not print to spamd: $!");
|
||||||
|
|
||||||
while (my $line = $transaction->body_getline) {
|
while (my $line = $transaction->body_getline) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
print SPAMD $line, CRLF
|
print SPAMD $line, CRLF
|
||||||
or warn "Could not print to spamd: $!";
|
or $self->log(LOGWARN, "Could not print to spamd: $!");
|
||||||
}
|
}
|
||||||
|
|
||||||
print SPAMD CRLF;
|
print SPAMD CRLF;
|
||||||
|
@ -60,7 +60,7 @@ sub register {
|
|||||||
$self->register_hook("data_post", "kav_scan");
|
$self->register_hook("data_post", "kav_scan");
|
||||||
|
|
||||||
if (@args % 2) {
|
if (@args % 2) {
|
||||||
warn "kavscanner: Wrong number of arguments";
|
$self->log(LOGWARN, "kavscanner: Wrong number of arguments");
|
||||||
$self->{_kavscanner_bin} = "/opt/AVP/kavscanner";
|
$self->{_kavscanner_bin} = "/opt/AVP/kavscanner";
|
||||||
} else {
|
} else {
|
||||||
my %args = @args;
|
my %args = @args;
|
||||||
|
Loading…
Reference in New Issue
Block a user