How to Build a Custom Exim System Filter File

February 19, 2024 / How-to Guide

This article explains how to build a custom Exim system filter file. Building a custom Exim system filter file allows for tailored email filtering configurations while avoiding the risk of losing changes during Exim Configuration rebuilds.

Caution- Avoid directly editing the /etc/cpanel_exim_system_filter file, as any alterations will be lost during Exim Configuration rebuilds.

To create a customised system filter file, follow these steps:

  1. Access the server as the root user.
  2. Execute the command below to duplicate the /etc/cpanel_exim_system_filter file-
    cp -p /etc/cpanel_exim_system_filter /etc/cpanel_system_filter_new

    Caution- It is highly advisable to create a copy of this file before making modifications. If issues arise, you can use the copied file to revert your changes.

  3. Ensure that the new file possesses the following ownership and file permissions-
    -rw-r--r-- 1 root root
  4. Utilise your preferred text editor to modify the /etc/cpanel_system_filter_new file.
  5. Go to the Basic Editor section within WHM’s Exim Configuration Manager Interface (WHM » Home » Service Configuration » Exim Configuration Manager).
    service configuration
  6. Opt for the text box option for the System Filter File setting.
    Caution- Irrespective of the selected option, the Exim configuration will include all files within the /usr/local/cpanel/etc/exim/sysfilter/options/ directory.
    system filter file
  7. Insert the absolute path of the new file in the text box (e.g., /etc/cpanel_system_filter_new).
  8. Save your changes.
    Note- Restarting Exim occurs automatically when saving changes within the Exim Configuration Manager interface.
    save

In this manner, building a personalised Exim system filter file becomes straightforward. For guidance on creating a custom filter rule file, please refer to our Knowledge Base section.

Spread the love