develooper Front page | perl.qpsmtpd | Postings from December 2015

uribl plugin issues

From:
Chris Dallimore
Date:
December 19, 2015 14:57
Subject:
uribl plugin issues
Message ID:
5675704B.7080801@pigstrough.co.uk
I had some problems with the uribl plugin:
- Always returning "pass, No URIs found in mail"
- URLs split over lines causing lookups to truncated domains
- Whitelist not being actioned ( for the second "while ($l =~ m{" loop )


I've made some changes that work for me, but it likely needs reviewing 
from those with more knowledge:

--- a/plugins/uribl
+++ b/plugins/uribl
@@ -271,6 +271,7 @@

          if ($l =~ /(.*)=$/) {
              push @qp_continuations, $1;
+            next;
          }
          elsif (@qp_continuations) {
              $l = join('', @qp_continuations, $l);
@@ -404,10 +405,13 @@
                ? 3
                : 2;
              if (
-                exists $self->{whitelist_zones}
-                ->{join('.', @host_domains[($cutoff - 1) .. 
$#host_domains])})
+                exists $self->{whitelist_zones}->{
+                    join('.',
+                         @host_domains[($#host_domains - $cutoff + 1)
+                           .. $#host_domains])
+                }
+               )
              {
-
                  $self->log(LOGINFO, "Skipping whitelist URI domain 
'$host'");
              }
              else {
@@ -498,7 +502,7 @@
      return \@matches;
  }

-sub hook_data {
+sub hook_data_post {
      my ($self, $transaction) = @_;

      return DECLINED if $self->is_immune();




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About