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:
Matt Sergeant 2005-03-03 02:37:04 +00:00
parent db546fe91c
commit 43aa207242
5 changed files with 8 additions and 8 deletions

View File

@ -42,7 +42,7 @@ sub mail_handler {
$bad =~ s/^\s*(\S+).*/$1/;
next unless $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")
if ($bad eq $from) || (substr($bad,0,1) eq '@' && $bad eq "\@$host");
}

View File

@ -38,7 +38,7 @@ sub mail_handler {
$bad =~ s/^\s*(\S+).*/$1/;
next unless $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")
if ($bad eq $from)
|| (substr($bad,0,1) eq '@' && $bad eq "\@$host");

View File

@ -43,7 +43,7 @@ sub check_dns {
}
}
else {
warn "$$ query for $host failed: ", $res->errorstring, "\n"
$self->log(LOGWARN, "$$ query for $host failed: ", $res->errorstring)
unless $res->errorstring eq "NXDOMAIN";
}
return 0;

View File

@ -138,18 +138,18 @@ sub check_spam {
# or CHECK or REPORT or SYMBOLS
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
or warn "Could not print to spamd: $!";
or $self->log(LOGWARN, "Could not print to spamd: $!");
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) {
chomp $line;
print SPAMD $line, CRLF
or warn "Could not print to spamd: $!";
or $self->log(LOGWARN, "Could not print to spamd: $!");
}
print SPAMD CRLF;

View File

@ -60,7 +60,7 @@ sub register {
$self->register_hook("data_post", "kav_scan");
if (@args % 2) {
warn "kavscanner: Wrong number of arguments";
$self->log(LOGWARN, "kavscanner: Wrong number of arguments");
$self->{_kavscanner_bin} = "/opt/AVP/kavscanner";
} else {
my %args = @args;