On Fri, May 15, 2015 at 11:55:38AM -0400, Alex Regan wrote:
> Hi,
> 
> >>>>Yes, it does appear to silence the warning. I'm also using
> >>>>DecodeShortURLs. I'll update the ticket.
> >>>
> >>>If you can please also open a ticket for the plugins you are using to
> >>>update their code, that would be helpful as well.
> >>
> >>Kartsten's GUDO plugin also uses  uri_to_domain
> >>
> >>What do we have to replace that function with?
> >
> >
> >Mail::SpamAssassin::Util::uri_to_domain($fubar)
> >
> >->
> >
> >$self->{main}->{registryboundaries}->uri_to_domain($fubar);
> 
> This appears to fix DecodeShortURLs.pm
> 
> --- DecodeShortURLs.pm.orig     2015-05-15 11:51:44.688835663 -0400
> +++ DecodeShortURLs.pm  2015-05-15 11:39:35.020499066 -0400
> @@ -486,7 +486,8 @@
>      [Mail::SpamAssassin::Util::uri_list_canonify (undef, $uri)];
> 
>    foreach (@{$info->{cleaned}}) {
> -    my ($dom, $host) = Mail::SpamAssassin::Util::uri_to_domain($_);
> +    my ($dom, $host) =
> $info->{main}->{registryboundaries}->uri_to_domain($_);
> 
>      if ($dom && !$info->{domains}->{$dom}) {
>        # 3.4 compatibility as per Marc Martinec
> 

For reference here too. Here's a working patch. Do not modify code at
random.  :-)


--- DecodeShortURLs.pm.orig     2015-05-15 19:19:07.000000000 +0300
+++ DecodeShortURLs.pm  2015-05-15 19:20:19.000000000 +0300
@@ -446,7 +446,7 @@

   # At this point we have a new URL in $response
   $pms->got_hit('HAS_SHORT_URL');
-  _add_uri_detail_list($pms, $location);
+  $self->_add_uri_detail_list($pms, $location);

   # Set chained here otherwise we might mark a disabled page or
   # redirect back to the same host as chaining incorrectly.
@@ -458,7 +458,7 @@
     my($host) = ($short_url =~ /^(https?:\/\/\S+)\//);
     $location = "$host/$location";
     dbg("Looks like a local redirection: $short_url => $location");
-    _add_uri_detail_list($pms, $location);
+    $self->_add_uri_detail_list($pms, $location);
     return $location;
   }

@@ -490,7 +490,7 @@
 # Beware.  Code copied from PerMsgStatus get_uri_detail_list().
 # Stolen from GUDO.pm
 sub _add_uri_detail_list {
-  my ($pms, $uri) = @_;
+  my ($self, $pms, $uri) = @_;
   my $info;

   # Cache of text parsed URIs, as previously used by get_uri_detail_list().
@@ -502,7 +502,7 @@
     [Mail::SpamAssassin::Util::uri_list_canonify (undef, $uri)];

   foreach (@{$info->{cleaned}}) {
-    my ($dom, $host) = Mail::SpamAssassin::Util::uri_to_domain($_);
+    my ($dom, $host) = $self->{main}->{registryboundaries}->uri_to_domain($_);

     if ($dom && !$info->{domains}->{$dom}) {
       # 3.4 compatibility as per Marc Martinec

Reply via email to