EXIM Custom Filter help

Secmas

Well-Known Member
Feb 18, 2005
364
13
168
Hi,
I have created the following EXIM Custom Filter but is not working, can you help me to find where is my issue?

Here is the code:
# Exim filter
if first_delivery
and ("$h_from:" contains ".(club|ninja|online|party|top|trade|vip|website|xyz)[>]?"))
then
fail text "Rejected by server policy rule"
seen finish
endif
I have also tried with escaping dot like "\\." and escaping "\\>" as well, but the same with no luck.

Thank you,
Sergio
 
Last edited:

rpvw

Well-Known Member
Jul 18, 2013
1,101
465
113
UK
cPanel Access Level
Root Administrator

Secmas

Well-Known Member
Feb 18, 2005
364
13
168
Hi rpvw,
before asking here, that was one of the many pages that I have been looking to help with my error but with no luck.
Thought that maybe some one could give a help pointing out my error, but seems it is not the way you do for help others.
But any way I thank you for your comment.
Regards,
Sergio
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
465
113
UK
cPanel Access Level
Root Administrator
Couple of thoughts:

You don't say what level you are writing this filter for, but it has to be a system filter (global) rather than a user filter as the "fail"command is only available to administrative levels.

I also wonder if you should be using "matches" instead of "contains" - it is the only test that mentions interpreting a regular PCRE expression in the second string.

Sorry I can't be more helpful :(
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

You may want to review some of the custom filter rules discussed on the following thread to see if they work for this purpose:

Need to filter ALL email

Thank you.