Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 26
  1. #1
    Member
    Join Date
    Jun 2003
    Posts
    33

    Default 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:?)

  2. #2
    Member
    Join Date
    Jun 2003
    Posts
    33

    Default 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)

  3. #3
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default

    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

  4. #4
    Member
    Join Date
    Dec 2004
    Posts
    28

    Default

    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.

  5. #5
    Member
    Join Date
    Jan 2006
    Posts
    50

    Default

    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

  6. #6
    Member serversphere's Avatar
    Join Date
    Jan 2004
    Posts
    658

    Default

    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

  7. #7
    Member kdarray's Avatar
    Join Date
    Apr 2006
    Location
    Washington
    Posts
    81

    Default thanks

    thanks jnagro for this short and sweet tip

  8. #8
    Member
    Join Date
    Mar 2002
    Location
    Dallas, TX
    Posts
    104
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Simple little addin to exim config, thanks!
    Last edited by alwaysweb; 12-11-2006 at 07:16 AM.
    Cheers,
    Ronnie T. Moore, Owner -- AIM, Yahoo: RonnieAWH
    http://AlwaysWebHosting.com -- Affordable, feature-packed cPanel hosting with Fantastico

  9. #9
    Member
    Join Date
    Dec 2004
    Posts
    28

    Default

    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?

  10. #10
    Member
    Join Date
    Jan 2006
    Posts
    50

    Default

    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.

  11. #11
    Member
    Join Date
    Dec 2004
    Posts
    28

    Default

    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.

  12. #12
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Default

    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!

  13. #13
    Registered User
    Join Date
    Oct 2006
    Posts
    2

    Default

    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!

  14. #14
    Member
    Join Date
    Nov 2002
    Posts
    153

    Default

    Hi,
    Trying it now
    Thanks
    Last edited by simplybe; 12-15-2006 at 07:15 PM.

  15. #15
    Member
    Join Date
    Dec 2004
    Posts
    28

    Default

    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.

Similar Threads & Tags
Similar threads

  1. Filed with Developers Exclude files from backup based on a defined maximum size threshold [Case 50767]
    By AlexAT in forum Feature Requests for cPanel/WHM
    Replies: 9
    Last Post: 10-03-2011, 12:14 PM
  2. HOWTO: Show the spam score in the subject line of spam taged messages
    By cpanelnick in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 02-06-2009, 05:08 PM
  3. X-Spam-Status: No, score=
    By Freezer in forum E-mail Discussions
    Replies: 5
    Last Post: 01-24-2008, 09:07 AM
  4. X-Spam-Status: Yes, score=0.0
    By Tymsah in forum E-mail Discussions
    Replies: 1
    Last Post: 08-18-2007, 05:29 AM
  5. SPAMD dropping spam and not sending
    By BigBirdy in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-02-2007, 05:04 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube