#1 (permalink)  
Old 12-05-2006, 02:12 PM
Registered User
 
Join Date: Jun 2003
Posts: 33
jnagro
exim: dropping spam based on score threshold?

I've made exim servers deny spam based on a score threshold, ie if the score is above X dont accept the message (deny) or :fail: it. I've poked around the cpanel config and its perl functions but i'm having a hard time adding it. Does anyone know where/how i can do that? I'm assuming ClamAV also won't accept malware? (deny? or :fail:?)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-05-2006, 04:37 PM
Registered User
 
Join Date: Jun 2003
Posts: 33
jnagro
figured it out...

i added this to the 'check_message' acl:

Code:
deny message = Spam score too high ($spam_score)
    spam = mailnull:true/defer_ok
    condition = ${if >{$spam_score_int}{150}{1}{0}}
which will deny any mail with a spam score of 15 or higher (fyi: exim will do something like score * 10 = 150, hence the 150)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-05-2006, 04:59 PM
mickalo's Avatar
Registered User
 
Join Date: Apr 2002
Location: N.W. Iowa
Posts: 745
mickalo is on a distinguished road
Quote:
Originally Posted by jnagro View Post
i added this to the 'check_message' acl:

Code:
deny message = Spam score too high ($spam_score)
    spam = mailnull:true/defer_ok
    condition = ${if >{$spam_score_int}{150}{1}{0}}
which will deny any mail with a spam score of 15 or higher (fyi: exim will do something like score * 10 = 150, hence the 150)
very handy Added it through the Exim Editor and watched the log file. seems to work quiet nicely:
Code:
tail -f /var/log/exim_rejectlog | grep "Spam score too high"

2006-12-05 15:45:56 1Gri6o-0006Os-Qa H=(dsl85-98-16622.ttnet.net.tr) [85.98.64.238] F=<unfulfilledtambourines@abwc.com> rejected after DATA: Spam score too high (17.0)
2006-12-05 15:47:12 1Gri7z-0006Rg-I5 H=foreaud.classcom.pl [195.150.77.145] F=<sadvoipreadinessuni@voipreadiness.com> rejected after DATA: Spam score too high (17.8)
2006-12-05 15:47:36 1Gri8M-0006T5-03 H=foreaud.classcom.pl [195.150.77.145] F=<sadxinergistixuni@xinergistix.com> rejected after DATA: Spam score too high (22.2)
Thx's
Mickalo
__________________

Thunder Rain Internet Publishing

Providing Internet Solutions that work!
Custom Perl and Database Programming
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-05-2006, 05:35 PM
Registered User
 
Join Date: Dec 2004
Posts: 28
alan-tor is on a distinguished road
Does :fail: work when specified in cPanel's "E-mail Filtering"?

I've created mail filters in cPanel's "E-mail Filtering", called "Filter Maintenance" once you're on that page. I set spam above a certain score to "Discard", but I wonder if :fail: would work there.

Actually, I'm wondering how this can work or how the original poster's idea can work. Presumably mail must first be received at the server in order to be scanned by SpamAssassin. So how can it be set to :fail: when it has already been received?

Last edited by alan-tor; 12-05-2006 at 06:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-06-2006, 07:47 AM
Registered User
 
Join Date: Jan 2006
Posts: 50
nxds is on a distinguished road
Quote:
Originally Posted by jnagro View Post
i added this to the 'check_message' acl:

Code:
deny message = Spam score too high ($spam_score)
    spam = mailnull:true/defer_ok
    condition = ${if >{$spam_score_int}{150}{1}{0}}
which will deny any mail with a spam score of 15 or higher (fyi: exim will do something like score * 10 = 150, hence the 150)
That rocks my world. Thx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 12-06-2006, 08:25 AM
serversphere's Avatar
Registered User
 
Join Date: Jan 2004
Posts: 651
serversphere is on a distinguished road
Be sure you add this through the Exim configuration editor in WHM. Adding this by editing the exim.conf file directly will cause cPanel to overwrite it the next time it updates.
__________________
Darren Benfer | SS-Darren | AIM: serversphere
www.serversphere.com
Dedicated Server Solutions Have Come Full Circle
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-09-2006, 01:24 PM
kdarray's Avatar
Registered User
 
Join Date: Apr 2006
Location: Washington
Posts: 81
kdarray is on a distinguished road
thanks

thanks jnagro for this short and sweet tip
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-11-2006, 06:48 AM
Registered User
 
Join Date: Mar 2002
Location: Dallas, TX
Posts: 102
alwaysweb
Simple little addin to exim config, thanks!
__________________
Cheers,
Ronnie T. Moore, Owner -- AIM, Yahoo: RonnieAWH
http://AlwaysWebHosting.com -- Affordable, feature-packed cPanel hosting with Fantastico

Last edited by alwaysweb; 12-11-2006 at 07:16 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-14-2006, 03:48 PM
Registered User
 
Join Date: Dec 2004
Posts: 28
alan-tor is on a distinguished road
Can someone please explain how this works?

Presumably mail must first be received at the server in order to be scanned by SpamAssassin. So how can it be set to :fail: when it has already been received?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 12-15-2006, 05:53 AM
Registered User
 
Join Date: Jan 2006
Posts: 50
nxds is on a distinguished road
Quote:
Originally Posted by alanvox View Post
Can someone please explain how this works?

Presumably mail must first be received at the server in order to be scanned by SpamAssassin. So how can it be set to :fail: when it has already been received?
The SMTP conversation isn't completed until the DATA verb is OK'd by the receiving server. In this test, the SA score is calculated after receiving the DATA section, and if too high the message is rejected, if not it is accepted into the queue for delivery. Rejecting the mail during any part of the SMTP conversation is a :fail: action and the sending server is responsible for any NDR, not yours.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 12-15-2006, 12:43 PM
Registered User
 
Join Date: Dec 2004
Posts: 28
alan-tor is on a distinguished road
Since SpamAssassin will scan the message and the message will be :fail:ed before being actually received, is it then possible to do this also for cPanel mail forwarders? I'd love to be able to have SpamAssassin work on mail forwarders rather than just on mail accounts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 12-15-2006, 02:16 PM
Registered User
 
Join Date: Apr 2002
Posts: 3
delsurf
Nice add!! I just installed it and it seems to be working great... I lowered the threshold to 80 though. Hopefully someone can find a way to do this for emails with forwarders.

Thanks again for the script config!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 12-15-2006, 06:38 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
sds1az is on a distinguished road
Yes indeed, very impressive, I put this in last night and checked my logs this morning and was stunned at how effective this is working. I highly recommend everyone to add this to their exim config, thanks for the tip jnagro!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 12-15-2006, 06:59 PM
Registered User
 
Join Date: Nov 2002
Posts: 151
simplybe
Hi,
Trying it now
Thanks

Last edited by simplybe; 12-15-2006 at 07:15 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 12-17-2006, 10:35 PM
Registered User
 
Join Date: Dec 2004
Posts: 28
alan-tor is on a distinguished road
Has anyone discovered whether this also works for cPanel mail forwarders?

Since SpamAssassin will scan the message and the message will be :fail:ed before being actually received, then it would seem that it should work for mail forwarders.

I'd love to be able to have SpamAssassin work on mail forwarders as well as on mail accounts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:14 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc