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

Diff of /spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm

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

--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	2004/12/04 09:32:27	109792
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	2004/12/04 09:39:12	109793
@@ -1367,36 +1367,24 @@ sub check_rbl_swe {
 # this only checks the address host name and not the domain name because
 # using the domain name had much worse results for dsn.rfc-ignorant.org
 sub check_rbl_from_host {
-  my ($self, $rule, $set, $rbl_server) = @_;
-
-  return 0 if $self->{conf}->{skip_rbl_checks};
-  return 0 unless $self->is_dns_available();
-
-  my %hosts;
-  for my $from ($self->all_from_addrs()) {
-    if ($from =~ m/\@(\S+\.\S+)/) {
-      $hosts{lc($1)} = 1;
-    }
-  }
-  return unless scalar keys %hosts;
-
-  $self->load_resolver();
-  for my $host (keys %hosts) {
-    $self->do_rbl_lookup($rule, $set, 'A', $rbl_server, "$host.$rbl_server");
-  }
+  _check_rbl_addresses(@_, $_[0]->all_from_addrs());
 }
 
 # this only checks the address host name and not the domain name because
 # using the domain name had much worse results for dsn.rfc-ignorant.org
 sub check_rbl_envfrom {
-  my ($self, $rule, $set, $rbl_server) = @_;
+  _check_rbl_addresses(@_, $_[0]->get('EnvelopeFrom:addr'));
+}
 
+sub _check_rbl_addresses {
+  my ($self, $rule, $set, $rbl_server, @addresses) = @_;
+  
   return 0 if $self->{conf}->{skip_rbl_checks};
   return 0 unless $self->is_dns_available();
 
   my %hosts;
-  for my $from ($self->get('EnvelopeFrom:addr')) {
-    if ($from =~ m/\@(\S+\.\S+)/) {
+  for my $address (@addresses) {
+    if ($address =~ m/\@(\S+\.\S+)/) {
       $hosts{lc($1)} = 1;
     }
   }

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26