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.

Bypass Spam Filter (DSpam) for local IPs

Discussion in 'E-mail Discussions' started by Shane3673, Apr 3, 2016.

  1. Shane3673

    Shane3673 Well-Known Member

    Joined:
    Dec 20, 2013
    Messages:
    96
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I have installed Dspam and SCMP for my spam filter, which I really like because it allows the user that hold the email address to use the webmail portal to train and release messages from their quarantine (much like boxtrapper without the verification emails). The support team for SMCP said the only way to bypass DSpam is to use a director to bypass it. The issue I am having is, for some reason, legit mail mostly from local accounts is being flagged as spam and quarantined. I have white-listed the publics on the server and 127.0.0.1 for local host in the WHM Exim settings, but this just bypasses the filters in Exim, it still passes it to DSpam afterward. Is there a way I can tell Exim to just deliver the messages directly to their mailbox instead of passing it to what should be the next step for other mail?
     
  2. Shane3673

    Shane3673 Well-Known Member

    Joined:
    Dec 20, 2013
    Messages:
    96
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Was able to do it by editing Exim Config here:


    “dspam_router:

    no_verify

    #uncomment the next line to disable dspam for virtual users.

    # check_local_user

    condition = "${if and { \

    {!eq {$sender_address_domain}{$domain}} \

    {!eq {$received_protocol}{local}} \

    {!eq {$received_protocol}{spam-scanned}} \

    } }"

    headers_add = "X-FILTER-DSPAM: by $primary_hostname on $tod_full"

    driver = accept

    transport = dspam_spamcheck”

    I just added {!eg {$sender_address_domain}{(domain)}} \


    replace (domain) with the domain you are wanting to bypass for. This way you need to create a line for every domain. I couldn't figure out how to get it to read local_domains in place of manually typing in each one on it's own line of code.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I am happy to see you were able to address the issue. Ensure you use the "Advanced Editor" via "WHM >> Service Configuration >> Exim Configuration Manager" to edit the configuration so the changes you make are preserved.

    Thank you.
     
  4. Shane3673

    Shane3673 Well-Known Member

    Joined:
    Dec 20, 2013
    Messages:
    96
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator

    Yep, I know this from other stuff I have done in exim.conf. You have any idea the right syntax if I wanted to pull domains from local_domains?
    Like:

    {!eq {$sender_address_domain}{local_domains}} \

    I tried this first and it didn't work so I think the syntax is off.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can find some examples of syntax to use for local domains in the following thread:

    Forward certain domain emails to Smart Host

    It's intended for a different purpose, but the custom configuration values offer examples of Exim syntax for local domain names.

    Thank you.
     
  6. Shane3673

    Shane3673 Well-Known Member

    Joined:
    Dec 20, 2013
    Messages:
    96
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Thanks. I will try this out when I have a chance and update the code here for anyone that might want it.
     
Loading...

Share This Page