Any one the settings to remove hostname and IP address in mail headers sent from Postfix mail server.
Tried, myhostname=domain.com in main.cf but now working as expected.
Any config pls share
Regards Siva
You cannot remove the hostname or IP. However, you can change them if you don't want to expose the actual hostname.
in the main.cf
file:
myhostname=myhostname.mydomain.com
myorigin=mydomain.com (or /etc/mailname and put your domain name in there)
inet_interfaces = <my_alt_IP>
Create a virtual NIC with it's own IP (eg eth0:0). Edit /etc/hosts
to add the new IP and alt hostname.
/^Received: .*/ IGNORE
to your pcre header-check in postfix main.cf. All locally added 'Received:' lines will be stripped except for very first 'relay' to the local SMTP (usually 127.0.0.1).
Do you mean that you want to amend or remove the Received: entry placed into an email header by your mail server? If so, note that section 4.4 of RFC 2821 says clearly that
An Internet mail program MUST NOT change a Received: line that was previously added to the message header. SMTP servers MUST prepend Received lines to messages
and moreover that your Received:
line
SHOULD contain both (1) the name of the source host as presented in the EHLO command and (2) an address literal containing the IP address of the source, determined from the TCP connection.
In other words, what you ask is an RFC violation. Don't do it, no matter who else thinks it's a good idea.
The Received-Header which contains the ip/helo/reverse dns of your postfix server is written by the RECEIVING mail server, not by your postfix, so there is no way to remove this. you could only remove received headers which contain information about the submitting mail client (header checks IGNORE rule)