store | blogs | forums | twitter | facebook | wiki | downloads | support portal
Atomic Secure Linux
It is currently Thu Oct 30, 2014 8:13 am

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Local SPF Rules for spamassassin and plesk
Unread postPosted: Thu Mar 05, 2009 11:20 am 
Offline
Forum User
Forum User

Joined: Thu Dec 20, 2007 7:17 pm
Posts: 15
Note: I'm using the qmail-scanner-queue.pl setup that is popular here.

I've found that having local SPF rules can speed up SpamAssassin if you have configured Plesk to add SPF Headers.

We decided to be a bit draconian with our SPF policy, so in Plesk>Server>Mail we set SPF checking mode to "Reject mails when SPF resolves to fail." (Forwarders be damned!)

The issue:
    Plesk performs a SPF check and adds a Received-SPF header. This is a remote DNS request.
    SpamAssassin performs another remote DNS request for SPF, completely ignoring the already written header.

The solution:
    Comment out "loadplugin Mail::SpamAssassin::Plugin::SPF" from /etc/mail/spamassassin/init.pre
    Create some local rules in /etc/mail/spamassassin/local.cf
    Code:
    report_safe 0
    rewrite_header  subject *****SPAM*****
    required_score  6.50

    header LOCAL_SPF_PASS Received-SPF =~ /^pass/
    header LOCAL_SPF_NEUTRAL Received-SPF =~ /^neutral/
    header LOCAL_SPF_SOFTFAIL Received-SPF =~ /^softfail/
    header LOCAL_SPF_FAIL Received-SPF =~ /^fail/

    score LOCAL_SPF_PASS     -0.001
    score LOCAL_SPF_NEUTRAL  2.199 1.210 0.756 0.686
    score LOCAL_SPF_SOFTFAIL 2.301 0.654 0.698 0.596
    score LOCAL_SPF_FAIL     2.600 0.992 1.669 0.693

    Restart spamd (/etc/init.d/spamassassin restart)

These local rules read the header that Plesk wrote. The scores are the defaults listed on the spamassassin wiki.


Top
 Profile  
 
 Post subject: Re: Local SPF Rules for spamassassin and plesk
Unread postPosted: Thu Mar 05, 2009 11:30 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 2092
This sounds like a great idea. Thank you.

Faris.

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group