L
L
lehha2014-09-26 12:58:13
postfix
lehha, 2014-09-26 12:58:13

Postfix relay - how to hide a chain of servers?

There is Postfix in the form of Relay, which accepts mail from trusted servers for forwarding to the open world (from a group of servers, for example, billing).
Is it possible in Postfix to hide the chain of servers through which the letter passed before reaching the Relay? For example, letters go like this:

Received: from mx.xxx.ru (mx.xxx.ru [xxx.xxx.xxx.xxx])
  by mxfront5h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id x;
  Thu, 25 Sep 2014 23:17:23 +0400
Received: from xxx.ru (xxx.ru [xxx.xxx.xxx.xxx])
  by mx.xxx.ru (Postfix) with ESMTP id 332467488DF
  for <[email protected]>; Thu, 25 Sep 2014 23:17:23 +0400 (MSK)
Received: by xxx.ru (Postfix, from userid 48)
  id 253767480028; Thu, 25 Sep 2014 23:17:23 +0400 (MSK)

We read below:
the first app-server xxx.ru, which actually created the letter, sent it to relay
the second server mx.xxx.ru and there is a relay that delivered it to yandex
How can I hide information about the first server on relay? The list of servers is limited, that is, the list of hosts / networks that need to be hidden is known.
Nothing criminal, I just want to hide information about the internal architecture of the service.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
J_o_k_e_R, 2014-10-03
@lehha

I faced a similar problem, only I cut out the IP addresses of the clients. But I recommend you do it by analogy:
In main.cf:
smtp_header_checks = pcre:/etc/postfix/anon-headers.pcre
/etc/postfix/anon-headers.pcre (change or remove headers):
/^User-Agent:/ IGNORE
/^X-Mailer:/ IGNORE
/^X-Originating-IP:/ IGNORE
/^Received: from (.* \([-._[:alnum:]]+ \ {7,15}\]\))(.*)\(Authenticated sender: ([^)]+)\)(.*)(by mydomain\.com) \(([^)]+)\) with (E?SMTPS?A?) id ([AF[:digit:]]+)(.*)/ REPLACE Received: from smtp-auth.domain.com (smtp-auth.domain.com [127.0.0.1] )$2(Authenticated sender: hidden)$4$5 ($6) with $7 id $8 $9 /^Received: by xxx.ru/
IGNORE
Need PCRE support in postfix.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question