The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to reject all emails by Apache SpamAssassin

Discussion in 'EasyApache' started by sadique, Dec 28, 2005.

  1. sadique

    sadique Member

    Joined:
    Jan 25, 2005
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Hello Folks,

    What would happen if I specify a domain or ip address in both blacklist_from and whitelist_from field of spamassassin. Tagged as spam or not? I want to to receive emails only from some domains and reject all other emails. Can this be done by blacklisting all and whitelisting the required domains?

    Thanks
     
  2. wzd

    wzd Well-Known Member

    Joined:
    Dec 16, 2005
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    South Africa
    cPanel Access Level:
    Root Administrator
    Lotsa stuff

    By adding lines such as:

    blacklist_from sde@spledee.com
    blacklist_from *@bonanzaoffers.com
    blacklist_from *@deal-seeker.com
    blacklist_from *@hispeedmediaoffers.com
    blacklist_from *@jumpjive.com
    blacklist_from *@*.ew01.com

    to /etc/mail/spamassassin/local.cf or ~/.spamassassin/user_prefs , you tell spamassassin that mail from any of these domains gets a +100 spam score, effectively blocking them.

    Then try whitelisting a specific domain? :)

    Otherwise if you are concerned about spam why not check out this black list:

    http://www.sa-blacklist.stearns.org/sa-blacklist/

    MORE:

    The following procmail script will delete mail with a score of 15 or higher. By moving the # (comment) mark up one line, it will save all mail with a score of 15 or higher in a separate folder rather than deleting. The general implementation then, is that mail with a score of less than 5 goes into the inbox, a client side rule triggering on "X-Spam-Status: YES" will cause mail scoring between 5 and 15 to go into a Junk Mail folder where it can regularly be checked, and mail of 15 or higher will be stored on the server or dropped on the floor.

    Code:
    Uncomment the following 3 lines and use tail -f procmail.log to debug
    #LOGFILE=$HOME/procmail.log
    #VERBOSE=yes
    #LOGABSTRACT=all
    
    # Send all mail through SpamAssassin
    
    :0fw: spamassassin.lock
    * < 256000
    | spamassassin
    
    
    # Mail that is very likely spam (>15) can be dropped on the floor.
    # Move the # up one line to save it on the server instead.
    # Note that dropping mail on the floor is a *bad*
    # idea unless you really, really believe no false positives will
    # have a score greater than 15.
    
    :0
    * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
    /dev/null
    #almost-certainly-spam
    http://wiki.apache.org/spamassassin/ProcmailToForwardMail

    Read that for more information :)

    I am not certain what will happen if you blacklist *@* and whitelist a certain *@domain.com but give it a go. In order to delete the emails you will use the above and provide all blacklisted emails with a score say above 15 or 100 and then use that procmail script.

    Let me know how it goes,
     

    Attached Files:

  3. sulca

    sulca Registered

    Joined:
    Aug 11, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have a similiar question: I want to whitelist a whole domain and blacklist certain specific users from that domain. The whitelist rule give -100.. according to your reply blacklisting gives +100.

    This would leave the score of the bad email around 0... thus allowing it to pass (my SA score is 1).

    I am a user, I do not know how to create rules. I do know that in the Configure SA options there is a section that allows you to overwrite scores but I do not know the name of the rule associated to the blacklist so I can set it to +200 for example.


    Oh and why don't my blacklisted emails get filtered through as normal spam into my spam-catching-account? They just dissapear or sometimes send error messages.


    Thanks in advance!
     
  4. sulca

    sulca Registered

    Joined:
    Aug 11, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Ok I found out how to do this with an account in cP 10

    score USER_IN_BLACKLIST ###

    Works great!

    For some reason it doesn't work the same in cP 11. I suspect that the rule is called differently. Any ideas?
     

Share This Page