Mail::...ountry(3pm)

πŸ’Œ Mail::SpamAssassin::Plugin::RelayCountry β€” the perl manual, but make it cute

okay bestie, welcome to the RelayCountry page πŸ’– this is a User Contributed Perl Documentation joint, aka a 3pm manual, and it's lowkey one of the most useful lil plugins out there. sit with me, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

RelayCountry β€” the plugin that adds message metadata telling you the country code of every relay the mail touched 🌍

✨ SYNOPSIS ✨

like, this is literally the whole setup, no cap:

loadplugin     Mail::SpamAssassin::Plugin::RelayCountry

that's it. that's the vibe. slay. πŸ’…

✨ DESCRIPTION ✨

so the RelayCountry plugin is out here trying its best to figure out the domain country codes of every single relay in the delivery path of a message, and then it drops that info straight into the message metadata. main character detective energy fr fr πŸ•΅οΈβ€β™€οΈ

here's the metadata headers and tags it adds β€” every single one, bestie, we're not skipping a thing:

  • X-Relay-Countries / _RELAYCOUNTRY_ β€” all untrusted relays. it contains every relay starting from the trusted_networks border. this method has been the default since early SA versions, so it's giving legacy icon πŸ‘‘
  • X-Relay-Countries-External / _RELAYCOUNTRYEXT_ β€” all external relays. contains every relay starting from the internal_networks border. could be useful in some cases when trusted/msa_networks extend beyond the internal border and those need to be checked too, yk?
  • X-Relay-Countries-All / _RELAYCOUNTRYALL_ β€” all possible relays, which is internal plus external. the whole squad 🫢
  • X-Relay-Countries-Auth / _RELAYCOUNTRYAUTH_ β€” Auth will contain all relays starting from the first relay that used authentication. for example, this could be used to check for hacked local users coming in from unexpected countries 😭 terrifying but iconic. and heads up: if there are no authenticated relays, this one will be empty. nada. ghosted. πŸ’€

✨ REQUIREMENT ✨

not little miss independent, unfortunately β€” this plugin uses Mail::SpamAssassin::GeoDB and it requires a module supported by it. the example given is MaxMind::DB::Reader (GeoIP2). no module, no country codes, no service. sorry bestie 🧚


lowkey a reminder: _RELAYCOUNTRYAUTH_ goes empty when nothing authenticated. that's not a bug, that's just how she is πŸ’œ

and that's the whole page, bestie!! this came to you from perl v5.40.1, dated 2026-07-23 β€” go forth and trace those relays, you absolute legend πŸŒˆβœ¨πŸ‘‘

πŸ“¦ where this page comes from