This adds hooks to dnsbl to support the dns_whitelist_soft plugin (to follow), which is a DNS-based whitelist of hosts (centrally managed).

John

p.s. Can you tell yet I am moving all of my servers to 0.28 and trying to get everything standardized?


Index: plugins/dnsbl
===================================================================
--- plugins/dnsbl       (revision 464)
+++ plugins/dnsbl       (working copy)
@@ -148,8 +148,20 @@
   }

   my $note = $self->process_sockets;
-  return (DENY, $note) if $note;
+  my $whitelist = $self->qp->connection->notes('whitelist');
+  if ( $note ) {
+    if ( $rcpt->user =~ /^(?:postmaster|abuse|mailer-daemon|root)$/i ) {
+      $self->log(2, "Don't blacklist special account: ".$rcpt->user);
+    }
+    elsif ( $whitelist ) {
+      $self->log(2, "Whitelist overrode blacklist: $whitelist");
+    }
+    else {
+      return (DENY, $note);
+    }
+  }
   return DECLINED;
+
 }

 sub disconnect_handler {

Reply via email to