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_ccuri_block_cidruri_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
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms