Remove the header from exim

chris0147

Well-Known Member
Aug 28, 2015
104
2
68
London
cPanel Access Level
Root Administrator
Hi all,

I need your help. I am using my own smtp server to connect so when I send the email I will get the two headers of Received: from which is from my smtp and from exim. So I would like to remove the header from the exim:

Received: from mail.mydomain.com ([107.xxx.xxx.xx]) by appmaildev.com with Microsoft SMTPSVC(8.5.9600.16384);
Fri, 30 Nov 2018 23:04:29 +0000



Can you please help me with how I can remove the header from the exim?

Do you know how I could do that?

If you know how I can remove it, do you know what file I need to configure or what I need to input in the header in order to get it to remove the header?

I want to know how to do it as I don't need two headers as I only need the header from my smtp server.

Thanks in advance
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,216
463
Hello @chris0147,

You'd need to setup a custom Exim filter rule to remove or replace specific aspects of the message header. This level of customization falls outside our general scope of support, however I'm happy to point you in the right direction. The following threads offer examples of methods you might use for this purpose:

Exim filter to rewrite 'From' address on certain incoming mail
How to remove X-Ham-Report from message header

If you need help developing the specific Exim filter rule, you may want to reach out to a system administrator. We provide a list of companies offering system administration services at:

System Administration Services | cPanel Forums

Thank you.
 

pincom_stu

Member
Oct 24, 2013
7
1
51
cPanel Access Level
Website Owner
Hi all,

I read through some of these older threads related to this issue, and just wanted to provide some more details on what I think is the best solution.

See here: How to Customize the Exim System Filter File | cPanel & WHM Documentation

I just verified it works and will not be overwritten by cPanel. It's a supported mechanism. Here's the example file file I have located under the directory /usr/local/cpanel/etc/exim/sysfilter/options:

# CUSTOM FILTER
if "${if def:header_X-PHP-Script: {there}}" is there
then
headers remove X-PHP-Script
endif

if "${if def:header_X-PHP-Originating-Script: {there}}" is there
then
headers remove X-PHP-Originating-Script
endif