Replace or Remove message header Received: from localhost

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
razmik
Posts: 19
Joined: Mon Aug 21, 2017 6:28 pm

Replace or Remove message header Received: from localhost

Post by razmik »

Dear all how I can replace or remove this message from message_header
I create customheader_check in this way

touch /opt/zimbra/conf/custom_header_checks
zmprov mcf zimbraMtaHeaderChecks 'pcre:/opt/zimbra/conf/postfix_header_checks pcre:/opt/zimbra/conf/custom_header_checks'
zmmtactl restart
service zimbra restart

#Zimbra version 8.7
root@mail:/opt/zimbra/conf# cat custom_header_checks
/^Received: from .*192\.168\.1.*/ REPLACE Received: from [KUKU]
/^Received: from .*127.0.0.1*/ IGNORE
/^Received: from .+\..+\.rplanet\.am .+(by localhost .+) / REPLACE Received: from [KUKU]
/^Received: from .*rplanet\.*/ REPLACE Received: from [KUKU]
/^Received: from .*mail.rplanet.am ([127.0.0.1]) by localhost (mail.rplanet.am [127.0.0.1])*/ REPLACE Received: from [KUKU]
/^\s*(Received: from)[^\n]*(.*for <.*@(?!rplanet.am).*)/ REPLACE $1 [1] (localhost [2])$2
/^Received:.*with ESMTPSA/ IGNORE
/^X-Originating-IP:/ IGNORE
/^X-Mailer:/ IGNORE
/^Mime-Version:/ IGNORE
#
/^Received: from .*\.local/ IGNORE
/^Received: from .*\.local/ IGNORE
/^Received: from .*localhost*/ REPLACE Received: from [KUKU]
/^Received: from .*^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$*/ REPLACE Received: from [KUKU]
/^Received: .*127\.0/ REPLACE Received: from [KUKU]
#############################################################
This is example from my email when I send test message

Received: from localhost (mail.rplanet.am [127.0.0.1]) by mail.rplanet.am (Postfix) with ESMTP id 23B6717C4 for <razmik.baghdasaryan@gmail.com>; Mon, 21 Aug 2017 22:48:02 +0400 (+04)
Received: from mail.rplanet.am ([127.0.0.1]) by localhost (mail.rplanet.am [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id o_x_L6djgJFF for <razmik.baghdasaryan@gmail.com>; Mon, 21 Aug 2017 22:48:01 +0400 (+04)

please help me

Regards,
Razmik
razmik
Posts: 19
Joined: Mon Aug 21, 2017 6:28 pm

Who can say why I see localhost or 127.0.0.1 or localhost.localdomain?

Post by razmik »

Hello everyone,
I send test message from zimbra to my gmail
and Who can say why I see localhost or 127.0.0.1 or localhost.localdomain into message header
I mean I have misconfguration
Please Help me

Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.rplanet.am (Postfix) with ESMTP id 482E02F11 for <razmik.baghdasaryan@gmail.com>; Wed, 23 Aug 2017 01:35:49 +0400 (+04)
Received: from mail.rplanet.am ([127.0.0.1]) by localhost (mail.rplanet.am [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 88KWpIvS_DJG for <razmik.baghdasaryan@gmail.com>; Wed, 23 Aug 2017 01:35:48 +0400 (+04)
Received: from [kuku]
X-Virus-Scanned: amavisd-new at rplanet.am
Received: from mail.rplanet.am ([127.0.0.1]) by localhost (mail.rplanet.am [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JlgQqztHYsNG for <razmik.baghdasaryan@gmail.com>; Wed, 23 Aug 2017 01:35:46 +0400 (+04)
Received: from [192.168.1.4] (unknown [37.186.102.153]) by mail.rplanet.am (Postfix) with ESMTPSA id 47E7E2FB4 for <razmik.baghdasaryan@gmail.com>; Wed, 23 Aug 2017 01:30:36 +0400 (+04)
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Replace or Remove message header Received: from localhost

Post by phoenix »

It's there because you sent an email via the Web UI, if you look at your own output after the "(127.0.0.1)" it says "by mail.rplanet.am (Postfix) with ESMTP" - that is perfectly normal.

BTW, do not create duplicate threads on the same topic, I've merged both of those threads.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Replace or Remove message header Received: from localhost

Post by phoenix »

razmik wrote:
phoenix wrote:In that case Can I replace localhost.localdomain to my domain name and 127.0.0.1 to my external address or how I can remove it from message header
Why would you want to do that when it doesn't cause any problems?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
razmik
Posts: 19
Joined: Mon Aug 21, 2017 6:28 pm

Re: Replace or Remove message header Received: from localhost

Post by razmik »

phoenix wrote:It's there because you sent an email via the Web UI, if you look at your own output after the "(127.0.0.1)" it says "by mail.rplanet.am (Postfix) with ESMTP" - that is perfectly normal.

BTW, do not create duplicate threads on the same topic, I've merged both of those threads.
In that case Can I replace localhost.localdomain to my domain name and 127.0.0.1 to my external address or how I can remove it from message header
Thanks in advance
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Replace or Remove message header Received: from localhost

Post by phoenix »

razmik wrote:
phoenix wrote:Why would you want to do that when it doesn't cause any problems?
I Want to hide all internal ip addresses include localhost.localdomain ip address for security and privacy, if you see, in message header also shown internal ip address to my pc "192.168.1.4" from which I send test mail
It's a waste of time, in my opinion, as it provides no additional security. A hacker can retrieve your internal IP addresses fairly easily - you've even given them a heads-up by posting them in this PUBLIC forum. :)
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
razmik
Posts: 19
Joined: Mon Aug 21, 2017 6:28 pm

Re: Replace or Remove message header Received: from localhost

Post by razmik »

phoenix wrote:Why would you want to do that when it doesn't cause any problems?
I Want to hide all internal ip addresses include localhost.localdomain ip address for security and privacy, if you see, in message header also shown internal ip address to my pc "192.168.1.4" from which I send test mail


Thanks,
razmik
Posts: 19
Joined: Mon Aug 21, 2017 6:28 pm

Re: Replace or Remove message header Received: from localhost

Post by razmik »

Yes you are right :)
But just now our mail server is postfix and we want to migrate into ZIMBRA in our postfix we use custom_header and Replace all names localhost and internal ip addresses to our domain name and external ip and now we are testing Zimbra all checks passed and we are only have problem with message header please help me if we resolve our problem we are migrate from postfix to ZIMBRA


Thanks,
I hope we can do it
Regards,
Razmik
hekler
Posts: 2
Joined: Wed Dec 26, 2018 7:59 am

Re: Replace or Remove message header Received: from localhost

Post by hekler »

Hi,
Did you resolve your problem?

Regards
razmik
Posts: 19
Joined: Mon Aug 21, 2017 6:28 pm

Re: Replace or Remove message header Received: from localhost

Post by razmik »

No friend I leave with localhost
hekler wrote:Hi,
Did you resolve your problem?

Regards
Post Reply