[Exim] Apply custom filter only to incoming messages

Operating System & Version
CENTOS 7.9 kvm
cPanel & WHM Version
v98.0.7

The Emperor

Member
May 9, 2018
16
1
53
Greece
cPanel Access Level
Root Administrator
I have the following custom global filter which rejects incoming emails with specific words or phrases into their subject.

However that works both ways, meaning that also messages from senders in my server are being blocked if the filter conditions are true which was meant to filter out only the incoming messages.

How can I make the filter condition to apply only in incoming messages and not to outgoing messages too ?

Code:
if $header_subject: contains "offer" or
   $header_subject: contains "upgrade" or
   $header_subject: contains "Attention"
then
  fail text "Rejected"
  seen finish
endif
 
Last edited:
  • Like
Reactions: cPJustinD

cPJustinD

Administrator
Staff member
Jan 12, 2021
286
52
103
Houston
cPanel Access Level
Root Administrator
Hi! Please note that cPanel does not support custom Exim configurations. You will need to work with your system administrator to configure customizations that only affect incoming emails.


I did find another thread where another user also requested guidance on customizing Exim filters for incoming messages. Some of the information here may be beneficial:

custom Exim filter for incoming mail

I hope that this helps. If you require further assistance in customizing these rules, you may need to reach out to an administrator familiar with Exim and customizing its configurations. If you do not have a system administrator, you can find one in our listings here:

System Administration Services