diff --git a/plugins/dnsbl b/plugins/dnsbl index 7bed581..7b82221 100644 --- a/plugins/dnsbl +++ b/plugins/dnsbl @@ -1,5 +1,23 @@ #!perl -w +=head1 NAME + +spamassassin - SpamAssassin integration for qpsmtpd + +=head1 DESCRIPTION + +Plugin that checks if the mail is spam by using the "spamd" daemon +from the SpamAssassin package. F + +SpamAssassin 2.6 or newer is required. + +=head1 CONFIG + +Configured in the config/dnsbl_zones files. One line per zone name, +for example + +=cut + sub register { my ($self, $qp, $denial ) = @_; if ( defined $denial and $denial =~ /^disconnect$/i ) { diff --git a/plugins/rhsbl b/plugins/rhsbl index 4003630..7c7dd79 100644 --- a/plugins/rhsbl +++ b/plugins/rhsbl @@ -1,4 +1,5 @@ + sub hook_mail { my ($self, $transaction, $sender) = @_; @@ -18,8 +19,14 @@ sub hook_mail { #push(@hosts, $helo) if $helo && $helo ne $sender->host; for my $host (@hosts) { for my $rhsbl (keys %rhsbl_zones) { + # fix to find TXT records, if the rhsbl_zones line doesn't have second field + if (defined($rhsbl_zones{$rhsbl})) { $self->log(LOGDEBUG, "Checking $host.$rhsbl for A record in the background"); $sel->add($res->bgsend("$host.$rhsbl")); + } else { + $self->log(LOGDEBUG, "Checking $host.$rhsbl for TXT record in the background"); + $sel->add($res->bgsend("$host.$rhsbl", "TXT")); + } $rhsbl_zones_map{"$host.$rhsbl"} = $rhsbl_zones{$rhsbl}; } } @@ -80,6 +87,10 @@ sub process_sockets { $result = $rr->name; $self->log(LOGDEBUG, "A record found for $result with IP " . $rr->address); last; + } elsif ($rr->type eq 'TXT') { + $result = $rr->txtdata; + $self->log(LOGDEBUG, "TXT record found: " . $rr->txtdata); + last; } } } else {