Answer the question
In order to leave comments, you need to log in
How to hide server IP address in mail headers?
There is a website and it is hidden behind cloudflare in order to protect against DDOS attacks
. Outgoing mail from the site had to be forwarded through another mail server to hide the real IP address of the server, but the IP in the FROM field is stored in the mail headers.
Initial data - postfix mail server, nginx + php-fpm web server
Answer the question
In order to leave comments, you need to log in
On the destination mail server, you need to cut the headers where the IP of the real web server is specified.
Create a file /etc/postfix/anon-headers.pcre with the contents
/^User-Agent:/ IGNORE
/^X-Mailer:/ IGNORE
/^X-Originating-IP:/ IGNORE
/^Received:/ IGNORE
systemctl restart postfix
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question