A
A
Alexey Zvyagintsev2019-03-16 18:37:41
Mail server
Alexey Zvyagintsev, 2019-03-16 18:37:41

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

2 answer(s)
U
uaVPS, 2019-03-16
@Sherminator

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

Add to the config /etc/postfix/main.cf anywhere
Restart postfix
systemctl restart postfix

O
office378, 2019-03-23
@office378

To protect the site, you need to allow web traffic only from the white list (cloudflare + your own)
Cloudflare IP list: https://www.cloudflare.com/ips-v4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question