Hide server IP Received: from - SMTP

Migdiradmin

Verified User
Joined
Jan 5, 2020
Messages
78
Hi i use cloudflare to protect one ip server, and i want to use one account in directadmin to user smtp services.

Server A (Cpanel) Apache/PHP
Server B (Directadmin) email

But wen i send one email from Server A with smtp from server B show the IP from server A.

Code:
Received: from serverA.com ([x.x.x.x] helo=localhost) by serverB.com with esmtpsa
  (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from <email@domain.com>) id 1jp72Z-0000Xc-Jk for @gmail.com; Sat, 27 Jun 2020 10:22:27 +0100
In the past i use services smtp like namecheap and they dont show the IP from server A.
Anyone have a solution?
 

Migdiradmin

Verified User
Joined
Jan 5, 2020
Messages
78
I have read to add this to exim.conf

remote_smtp:
driver = smtp
headers_remove = Received

But exim fails to start, any clue?
 

sysdev

Verified User
Joined
Jul 16, 2007
Messages
192
It probably fails because you miss the ':' behind the Received header. But it's server B who adds the address of server A. If you are server A, you won't be able to remove your ip address from the headers.
 

Migdiradmin

Verified User
Joined
Jan 5, 2020
Messages
78
This works but removes but removes Received: from entirely and i just want to hide IP from A server in the Received: from.

Code:
#COMMENT#61:
remote_smtp:
  driver = smtp
  headers_remove = Received
  headers_add = "${if def:authenticated_id{X-Authenticated-Id: ${authenticated_id}}}"
  interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}}
  helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
  hosts_try_chunking =
  hosts_try_fastopen =
.include_if_exists /etc/exim.dkim.conf
Any ideas?
 
Top