Outgoing email filter

Ali Hamra

Registered
May 26, 2017
1
0
1
Amman
cPanel Access Level
Root Administrator
Hello,
I have created multiple of email accounts via cPanel and what i am willing to do is that i want to assign two of the created e-mails to only send and receive e-mails from the same domain name and discarding any e-mails either outgoing or incoming that does not match the domain name assigned.
I went through the E-mail filter and created many rules, as an example of outgoing :
To -> Does not contain -> @mydomain.com
or
To -> Does not end with -> @mydomain.com

No matter what rule i create, it always pass these conditions and the user can easily send e-mails without be notified that this action is not allowed.

However, i can assure that incoming mails works fine as needed, but as for outgoing only problem occurs.
Also I've used "Filer Test" and the result is a success for both ways ! But accessing Webmail ( roundcube or horde ) the problem occurs.

Am i missing something here ?
Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello,

Email filters that you configure in cPanel only apply to incoming email. You'd need to configure a system filter rule for Exim (this requires root access to the server) if you want to filter outgoing email. Here's a document that explains how to setup a system filter rule:

How to Customize the Exim System Filter File - cPanel Knowledge Base - cPanel Documentation

You'd have to ensure the rule included a "FROM" and "TO" option to ensure it only applies to specific email accounts.

Let us know if you have any questions.

Thanks!