SpamAssassin - RelayCountry

最後更新: 2018-04-10


The RelayCountry plugin will add metadata to the Bayesian filtering process,

allowing the Bayesian filters to learn information based on countries.




# /etc/mail/spamassassin/init.pre

loadplugin Mail::SpamAssassin::Plugin::RelayCountry

# This plugin requires the "Geo::IP" Perl module

# C7 (epel):

yum install perl-Geo-IP


B/W Country



#### RelayCountry ####
header          RELAYCOUNTRY_GOOD X-Relay-Countries =~ /HK/
describe        RELAYCOUNTRY_GOOD Relayed through HK
score           RELAYCOUNTRY_GOOD -0.1

header          RELAYCOUNTRY_BAD X-Relay-Countries =~ /^(CN|FI|SE)/
describe        RELAYCOUNTRY_BAD First untrusted relay are CN,FI,SE
score           RELAYCOUNTRY_BAD 0.1

Country Codes:

A list of 2-letter ISO 3166 country codes

IPs not found in database are marked with 'XX'


Add header


Add a separate MIME header that shows all the message's relay countries, independent of the rules:

i.e. MIME header

X-Spam-Relay-Country: US CN RU


# /etc/mail/spamassassin/

add_header all Relay-Country _RELAYCOUNTRY_

service spamassassin restart





Creative Commons license icon Creative Commons license icon