To create a custom system filter file, perform the following steps:
1) Log in to your server as the root user.
2) Use the following command to copy the /etc/cpanel_exim_system_filter file:
```
cp -p /etc/cpanel_exim_system_filter /etc/cpanel_system_filter_new
```
3) You can edit the /etc/cpanel_system_filter_new file and put below code at the end of the file. Refer below image for more info:
```
if
$header_from: contains "@qq.com"
then
if error_message then save "/dev/null" 660 else fail "Messages from this domain are blocked." endif
endif
```
If you wish to block the emails from another domain, then you can change the domain instead of qq.com.
4) and then update the new file path under WHM's Exim Configuration Manager interface WHM >> Home >> Service Configuration >> Exim Configuration Manager. Refer this below image for more details.
In the Basic Editor section of the interface, select the textbox option for the System Filter File setting.
5) Enter the new file path in the text box (e.g, /etc/cpanel_system_filter_new)
6) and then click on Save.
That's it.
Leave a comment: