Introduction
Sometimes you need to make custom modifications to the Exim filters. You finally get everything working correctly, just the way you like it. Then there is an update, and you notice your custom changes are no longer present.
Procedure
To prevent your custom Exim filters from being overwritten during updates, you will want to create a custom Exim system filter file or custom filter rule files to be included in the Exim configuration.
How to create a custom filter rule file
To create a custom filter rule file, perform the following steps:
- Create a file in the /usr/local/cpanel/etc/exim/sysfilter/options/ directory.
- Within that file, enter your custom filter rules.
- Navigate to WHM’s Exim Configuration Manager interface (WHM >> Home >> Service Configuration >> Exim Configuration Manager). In the Basic Editor section, select the Filters tab.
- Disable any undesired filter rules.
- Click Save.
Warning: The Exim configuration enables all of the custom filter rules within the /usr/local/cpanel/etc/exim/sysfilter/options/ directory.
How to create a custom Exim system filter file
Warning: Do not directly edit the /etc/cpanel_exim_system_filter file. The system will lose any changes when your Exim Configuration rebuilds.
Warning: Do not use the following reserved filter names for your new filter file.
- attachments
- fail_spam_score_over_100
- fail_spam_score_over_125
- fail_spam_score_over_150
- fail_spam_score_over_175
- fail_spam_score_over_200
- fail_spam_score_over_int
- nullroot
- spam_rewrite
To create a custom system filter file named "cpanel_system_filter_custom", perform the following steps:
- Log in to the server as the root user.
- Run the following command to copy the /etc/cpanel_exim_system_filter file:
cp -p /etc/cpanel_exim_system_filter /etc/cpanel_system_filter_custom - Confirm that the new file has the following ownership and file permissions:
-rw-r--r-- 1 root root - Use your preferred text editor to edit the /etc/cpanel_system_filter_custom file.
- Navigate to the Basic Editor section of WHM’s Exim Configuration Manager interface (WHM >> Home >> Service Configuration >> Exim Configuration Manager).
- Select the textbox option for the System Filter File setting. (Warning: Regardless of which option you select, the Exim configuration will include all of the files within the /usr/local/cpanel/etc/exim/sysfilter/options/ directory.)
- Enter the new file’s absolute path in the text box:
/etc/cpanel_system_filter_custom - Click Save. (Note: Exim restarts when you save changes in the Exim Configuration Manager interface.)
You may also want to review the Exim documentation: Chapter 3 - Exim filter files
Consider subscribing to the Exim users mailing list and asking other administrators for assistance: https://lists.exim.org/mailman/listinfo/exim-users
For further information on customizing your Exim system filter, please review our documentation page: How to Customize the Exim System Filter File
Comments
0 comments
Article is closed for comments.