Author: vetinari
Date: Tue May 20 06:27:14 2008
New Revision: 915

Modified:
   contrib/vetinari/dnswl

Log:
add wl_conn parameter to set connection->notes("whitelisthost") based on score

Modified: contrib/vetinari/dnswl
==============================================================================
--- contrib/vetinari/dnswl      (original)
+++ contrib/vetinari/dnswl      Tue May 20 06:27:14 2008
@@ -39,6 +39,12 @@
 running a second time with a smaller override list (B<use this for all but the
 first if you're running this plugin more than once>). Defaults to B<false>.
 
+=item wl_conn SCORE
+
+Set the connection note C<whitelisthost> if the dnswl score is greater or equal
+than SCORE. This note is read by several plugins from the qpsmtpd core 
+distribution (like C<check_earlytalker>, C<greylisting>, C<dnsbl>,...)
+
 =head1 ACCESSING DNSWL INFO
 
 Other plugins can get the score via
@@ -149,6 +155,8 @@
 
     $self->{_dnswl_ignore} = exists $args{ignore_fail} ? $args{ignore_fail} : 
0;
 
+    $self->{_dnswl_wl_conn} = exists $args{wl_conn} ? $args{wl_conn} : -1;
+
     return (DECLINED);
 }
 
@@ -194,6 +202,9 @@
     }
     
     if (defined $score) {
+        $self->qp->connection->notes("whitelisthost", $self->{_dnswl_wl_conn})
+          if $self->{_dnswl_wl_conn} > -1
+
         # undef if $self->{_dnswl_ignore} is true and not found
         $self->qp->connection->notes("dnswl", $score);
         defined $id

Reply via email to