Introduction
This article provides the steps to create an Exim system filter to prepend the subject of emails.
Please note that cPanel does not provide support for customizing the specific contents of your Exim filters. If you need help crafting a custom filter, you should contact a systems administrator with the skills, training, and expertise required to do so.
Procedure
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Create the
/usr/local/cpanel/etc/exim/sysfilter/options/subject_rewrite
filter file.touch /usr/local/cpanel/etc/exim/sysfilter/options/subject_rewrite
- Open the
subject_rewrite
file in your preferred text editor. - Add the following to the file.
if
Please note that "$string" and "$prepenedtext" must be replaced by the email subject to be prepended and the text to prepend the subject with.
$h_subject: contains "$string"
then
headers add "Old-Subject: $h_subject:"
headers remove "Subject"
headers add "Subject: $prepenedtext $h_old-subject"
headers remove "Old-Subject"
endif - Save the changes and exit the text editor.
- Log into WHM as the ‘root’ user.
- Navigate to "Home / Service Configuration / Exim Configuration Manager."
- Click on the "Filters" tab.
- Ensure that "Custom Filter: subject_rewrite" is set to "On."
- Click the "Save" button.
Additional resources
Exim Internet Mailer: Chapter 3 - Exim filter files
Exim Internet Mailer: Chapter 47 - System-wide message filtering
Comments
0 comments
Article is closed for comments.