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.

 


Install

 

# /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

 

/etc/mail/spamassassin/local.cf

#### 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

http://www.iana.org/cctld/cctld-whois.htm

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

Setting:

# /etc/mail/spamassassin/local.cf

add_header all Relay-Country _RELAYCOUNTRY_

service spamassassin restart

 


 

 

 

Creative Commons license icon Creative Commons license icon