/[Apache-SVN]/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm
ViewVC logotype

Diff of /spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 596095, Sun Nov 18 16:11:20 2007 UTC revision 646805, Thu Apr 10 13:59:09 2008 UTC
# Line 60  Example: Line 60  Example:
60   body            URIBL_SBLXBL    eval:check_uridnsbl('URIBL_SBLXBL')   body            URIBL_SBLXBL    eval:check_uridnsbl('URIBL_SBLXBL')
61   describe        URIBL_SBLXBL    Contains a URL listed in the SBL/XBL blocklist   describe        URIBL_SBLXBL    Contains a URL listed in the SBL/XBL blocklist
62    
63    =item uridnssub NAME_OF_RULE dnsbl_zone lookuptype subtest
64    
65    Specify a DNSBL-style domain lookup with a sub-test.  C<NAME_OF_RULE> is the
66    name of the rule to be used, C<dnsbl_zone> is the zone to look up IPs in,
67    and C<lookuptype> is the type of lookup (B<TXT> or B<A>).
68    
69    C<subtest> is the sub-test to run against the returned data.  The sub-test may
70    either be an IPv4 dotted address for DNSBLs that return multiple A records or a
71    non-negative decimal number to specify a bitmask for DNSBLs that return a
72    single A record containing a bitmask of results.
73    
74    Note that, as with C<uridnsbl>, you must also define a body-eval rule calling
75    C<check_uridnsbl()> to use this.
76    
77    Example:
78    
79      uridnssub   URIBL_DNSBL_4    dnsbl.example.org.   A    127.0.0.4
80      uridnssub   URIBL_DNSBL_8    dnsbl.example.org.   A    8
81    
82  =item urirhsbl NAME_OF_RULE rhsbl_zone lookuptype  =item urirhsbl NAME_OF_RULE rhsbl_zone lookuptype
83    
84  Specify a RHSBL-style domain lookup.  C<NAME_OF_RULE> is the name of the rule  Specify a RHSBL-style domain lookup.  C<NAME_OF_RULE> is the name of the rule
# Line 326  sub set_config { Line 345  sub set_config {
345    });    });
346    
347    push (@cmds, {    push (@cmds, {
348        setting => 'uridnssub',
349        is_priv => 1,
350        code => sub {
351          my ($self, $key, $value, $line) = @_;
352          if ($value =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\d{1,10}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
353            my $rulename = $1;
354            my $zone = $2;
355            my $type = $3;
356            my $subrule = $4;
357            $self->{uridnsbls}->{$rulename} = {
358             zone => $zone, type => $type,
359              is_rhsbl => 0, is_subrule => 1
360            };
361            $self->{uridnsbl_subs}->{$zone} ||= { };
362            push (@{$self->{uridnsbl_subs}->{$zone}->{$subrule}->{rulenames}}, $rulename);
363          }
364          elsif ($value =~ /^$/) {
365            return $Mail::SpamAssassin::Conf::MISSING_REQUIRED_VALUE;
366          }
367          else {
368            return $Mail::SpamAssassin::Conf::INVALID_VALUE;
369          }
370        }
371      });
372    
373      push (@cmds, {
374      setting => 'urirhsbl',      setting => 'urirhsbl',
375      is_priv => 1,      is_priv => 1,
376      code => sub {      code => sub {

Legend:
Removed from v.596095  
changed lines
  Added in v.646805

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2