You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2022/05/25 13:36:18 UTC

svn commit: r1901240 - /spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm

Author: hege
Date: Wed May 25 13:36:17 2022
New Revision: 1901240

URL: http://svn.apache.org/viewvc?rev=1901240&view=rev
Log:
Allow "max_short_urls 0" to disable all HTTP requests, enabling usage of short_url() as a list lookup only.

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm?rev=1901240&r1=1901239&r2=1901240&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm Wed May 25 13:36:17 2022
@@ -67,7 +67,8 @@ another short URL.  Redirection depth li
 C<max_short_url_redirections>.
 
 Maximum of C<max_short_urls> short URLs are checked in a message (10 by
-default).
+default).  Setting it to 0 disables HTTP requests, allowing only short_url()
+test to work and report found shorteners.
 
 All supported rule types for checking short URLs and redirection status are
 documented in L<SYNOPSIS> section.
@@ -391,6 +392,9 @@ Maximum time a short URL HTTP request ca
 Maximum amount of short URLs that will be looked up per message.  Chained
 redirections are not counted, only initial short URLs found.
 
+Setting it to 0 disables HTTP requests, allowing only short_url() test to
+work and report any found shortener URLs.
+
 =back
 
 =cut
@@ -750,8 +754,9 @@ sub _check_short {
   # Mark that a URL shortener was found
   $pms->{short_url} = 1;
 
-  # Bail out if network lookups not enabled
+  # Bail out if network lookups not enabled or max_short_urls 0
   return if $self->{net_disabled};
+  return if !$conf->{max_short_urls};
 
   # Initialize cache
   $self->initialise_url_shortener_cache($conf);