Mail::...ocalBL(3pm)

πŸ’– NAME πŸ’–

URILocalBL β€” ok so basically this is the glow-up that lets you blocklist URIs using local information, aka ISP names, address lists, and country codes. she's surgical, she's picky, she's yours bestie πŸŽ€


✨ SYNOPSIS ✨

So this plugin is out here making brand new rule test types for you, like:

  • uri_block_cc
  • uri_block_cidr
  • uri_block_isp

and these rules vibe-check the URIs chillin' in the HTML portion of a message β€” yk, the <a href=...> markup type beat πŸ‘‘

loadplugin    Mail::SpamAssassin::Plugin::URILocalBL

πŸ¦‹ bestie why are we even doing local blocklisting

ngl there are some genuinely excellent, effective, and well-maintained DNSBLs out there. they ate. but they have ✨drawbacks✨ and we gotta be honest about them:

  • blocklists can cover tens of thousands of entries, and you can't select which ones you use 😭 like okay warden
  • verifying that it's correctly configured can be non-trivial πŸ’€
  • new blocklisting entries may take a while to be detected and entered, so it's not instantaneous πŸ™ˆ

Sometimes all you want is a quick, easy, and very surgical blocklisting of a particular site or a particular ISP. this plugin was literally defined for that exact usage case. no cap. that's her whole purpose. periodt πŸ’…


πŸ‘‘ RULE DEFINITIONS AND PRIVILEGED SETTINGS πŸ‘‘

The format for defining a rule is as follows:

uri_block_cc SYMBOLIC_TEST_NAME cc1 cc2 cc3 cc4 ..
uri_block_cc SYMBOLIC_TEST_NAME !cc1 !cc2 ..

or:

uri_block_cont SYMBOLIC_TEST_NAME co1 co2 co3 co4 ..
uri_block_cont SYMBOLIC_TEST_NAME !co1 !co2 ..

or:

uri_block_cidr SYMBOLIC_TEST_NAME a.a.a.a b.b.b.b/cc

or:

uri_block_isp SYMBOLIC_TEST_NAME "Data Rancid" McCarrier Phishers-r-Us

🌸 example time (example rule for matching a URI in China)

uri_block_cc TEST1 cn

If you specify list of negations, such rule will match ANY country except the listed ones (Finland, Sweden):

uri_block_cc TEST1 !fi !se

Continents uri_block_cont works exactly the same as uri_block_cc. same energy, different continent 🌈

This would block the URL http://www.baidu.com/index.htm. Similarly, to match a Spam-haven netblock:

uri_block_cidr TEST2 65.181.64.0/18

would match a netblock where several phishing sites were recently hosted. caught in 4k fr fr πŸ“


And to block all CIDR blocks registered to an ISP, one might use:

uri_block_isp TEST3 "Data Rancid" ColoCrossing
Quote ISP names containing spaces. yes literally put them in quotes, don't be shy bestie πŸ’œ

Lastly, if there's a country that you want to block but there's an explicit host you wish to exempt from that blocklist, you can use:

uri_block_exclude TEST1 www.baidu.com

if you wish to exempt URL's referring to this host. The same syntax is applicable to CIDR and ISP blocks as well. exempting your faves, iconic behavior 🫢


🧚 DEPENDENCIES 🧚

The Country-Code based filtering can use any Mail::SpamAssassin::GeoDB supported module like MaxMind::DB::Reader (GeoIP2) or Geo::IP. 🌈

ISP based filtering might require a paid subscription database like GeoIPISP. yes bestie, sometimes the vibe costs money πŸ’Έ


and that's the whole page, you're so welcome πŸ’– this gorgeousness lives in the User Contributed Perl Documentation collection, it shipped as perl v5.40.1 on 2026-07-23, and the manual is Mail::...ocalBL(3pm) β€” mwah, go block some bad URIs, you got this πŸŽ€βœ¨

πŸ“¦ where this page comes from