OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: smtpd_sender_restrictions

From: mouss (usebsdfree.fr)
Date: Fri Dec 01 2006 - 17:32:52 CST


Jorey Bump wrote:
> Carlos Eduardo R. L. de Miranda wrote:
>
>> Our server is receiving lots of spam messages from servers with Russian
>> domain.
>> I would like to block every message from Russian domains.
>
> If you must block by country, use an RBL:
>
> http://countries.nerd.dk/
>
> However, I find such RBLs more useful in a scoring system. Here's what
> I do in my SpamAssassin local.cf (watch the wrap):
>
> # first discover country code of origin using a TXT lookup
> header RCVD_COUNTRIES eval:check_rbl_txt('nerd-zz',
> 'zz.countries.nerd.dk.')
> describe RCVD_COUNTRIES Received from countries.nerd.dk
> tflags RCVD_COUNTRIES net
> # All countries get a point by default
> score RCVD_COUNTRIES 1.0

Instead of querying a DNSBL:

loadplugin Mail::SpamAssassin::Plugin::RelayCountry

header COUNTRY_US X-Relay-Countries=~/\bUS\b/
describe COUNTRY_US Relayed via United States
score COUNTRY_US 0.01