Using the Exim system filter, you can modify the headers of email handled by Exim.
Exim's documentation describes the Exim system filter as follows:
"[The Exim system filter] is a mechanism for checking messages once they have been received, but before they are delivered. [The system filter] is run just once per message [...] at the start of a delivery attempt, before any routing or transport is done."
To add custom filter rules to your Exim configuration, you may create separate custom system filter rule files for Exim to include in its configuration or create an individual system filter file. Both of these actions can be done per our documentation here: https://docs.cpanel.net/knowledge-base/email/how-to-customize-the-exim-system-filter-file/
For the purpose of removing a header, you can use the following directive where <string> is replaced by the header you'd like removed:
headers remove <string>
Here's an example where two headers are removed:
if "${if def:header_X-Spam-Subject: {there}}" is there
then
headers remove Subject
headers add "Subject: $rh_X-Spam-Subject:"
headers remove X-Spam-Subject
endif
Here's an example of how to test your system filter for syntax errors, where somefilter.conf is the location of your filter and testemail.eml is the location of your test email:
exim -bF somefilter.conf < testemail.eml
To read more about Exim system filters and the command to remove headers, please refer to Exims documentation here: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-systemwide_message_filtering.html