Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cpanel_exim_system_filter block by subject

Discussion in 'E-mail Discussion' started by z3d3m0n, Feb 27, 2019.

  1. z3d3m0n

    z3d3m0n Active Member

    Joined:
    Feb 8, 2016
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Prague
    cPanel Access Level:
    Root Administrator
    Hey Guys,

    i am trying to work with cpanel_exim_system_filter. Need to block incoming emails with subject that contains Your accounts was hacked.i have enabled it in Exim Configuration Manager

    i have entered the code to the cpanel_exim_system_filter but the emails are still getting in

    Code:
    if ("$h_subject:"contains "Your accounts was hacked")
    or  ("$h_subject:"Your accounts was compromised")
    then fail
    endif
    
    i have checked the manual
    How to Customize the Exim System Filter File - cPanel Knowledge Base - cPanel Documentation

    is there any extended reference for the variables that i can use like , $h_subject etc

    any advices are welcome

    thx
     
  2. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    1,088
    Likes Received:
    441
    Trophy Points:
    113
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    For filters using the "contains" evaluation; try using the AND operator instead of the OR operator
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelLauren likes this.
  3. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,791
    Likes Received:
    442
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @z3d3m0n

    I'd go with the recommendation by @rpvw, I'd also always create the filter in cPanel's Global/User filters then copy that syntax. I did something like this for you:

    Code:
    if
     $header_subject: contains "Your accounts was hacked"
     or $header_subject: contains "Your accounts was compromised"
    then
     if error_message then save "/dev/null" 660 else fail "No spam here" endif
     finish
    endif
    Keep in mind the full subject needs to match what's in the quotes for this to work as well including caps and spelling
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice