DecodeShortUrls

This plugin was deprecated in favor of the Redirectors plugin as of SpamAssassin 4.0.3.

This plugin looks for URLs shortened by a list of URL shortening services. Upon finding a matching URL, plugin will send a HTTP request to the shortening service and retrieve the Location-header which points to the actual shortened URL. It then adds this URL to the list of URIs extracted by SpamAssassin which can then be accessed by uri rules and plugins such as URIDNSBL.

How it works

Warden enables the Mail::SpamAssassin::Plugin::DecodeShortURLs plugin, which runs at priority -10 so it can modify the parsed URI list before the normal uri rules or the URIDNSBL plugin run (but after the Redirector plugin).

When the plugin finds a URL from a configured shortening service, it sends an HTTP request to the shortening service to retrieve the Location header that points to the actual destination URL. The request uses the HEAD method by default, or GET for services listed with url_shortener_get (for example, bit.ly). It then adds the decoded URL to the list of URIs extracted by SpamAssassin, which URI rules and plugins such as URIDNSBL can then score.

Lookups are cached so the same short URL is not requested repeatedly. Warden uses the url_shortener_cache_type setting to select the cache (default dbi).

Rules

Area Rule name Description Default scores
body HAS_SHORT_URL Message has one or more shortened URLs --
body SHORT_URL_REDIR Message has shortened URL that resulted in a valid redirection --
body SHORT_URL_CHAINED Message has shortened URL chained to other shorteners 0.01
body SHORT_URL_MAXCHAIN Message has shortened URL that causes too many redirections --
body SHORT_URL_LOOP Message has short URL that loops back to itself --
body SHORT_URL_200 Message has shortened URL returning HTTP 200 --
body SHORT_URL_404 Message has shortened URL returning HTTP 404 --
uri URL_SHORTENER_DISABLED Message contains shortened URL that has been disabled due to abuse 2

Related Pages