cpanel_exim_system_filter block by subject

z3d3m0n

Active Member
Feb 8, 2016
32
1
8
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
 

rpvw

Well-Known Member
Jul 18, 2013
1,088
446
113
UK
cPanel Access Level
Root Administrator
For filters using the "contains" evaluation; try using the AND operator instead of the OR operator
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
648
263
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