1

Topic: How to remove hostname from "Received" header in sent emails?

Hello

Configuration: latest iRedMail on ubuntu 20 with downloadable installer. VPS with multiple failover IPs at OVH one domain with proper PTR on her own IP. Configured by the book :-) with 10/10 email score. I'm extremely happy with iRedMail and its documentation. Practically everything is clear and possible :-) There's one small, little problem though...

Here is /etc/hostname:

admin

Here is /etc/hosts:

127.0.0.1    admin.rav.ovh    admin    localhost    localhost.localdomain

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost    ip6-loopback
fe00::0    ip6-localnet
ff00::0    ip6-mcastprefix
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters
ff02::3    ip6-allhosts

127.0.1.1    vps-XXXXXX.vps.ovh.net    vps-XXXXXX

Here is sdd_transport.pcre:

/@address1\.tld$/   address1-tld-smtp:
/@address2\.tld$/   address2-tld-smtp:
/@qnews\.link$/   qnews-link-smtp:

Here is master.cf:

address1-tld-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=146.xx.xx.xx
    -o smtp_helo_name=mail.address1.tld
    -o syslog_name=postfix-address1-tld
    -o myhostname=mail.address1.tld

address2-tld-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=146.xx.xx.xx
    -o smtp_helo_name=mail.address2.tld
    -o syslog_name=postfix-address2-tld
    -o myhostname=mail.address2.tld

qnews-link-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=146.59.79.25
    -o smtp_helo_name=mail.qnews.link
    -o syslog_name=postfix-qnews-link
    -o myhostname=mail.qnews.link

Below is email received by gmailaccount@gmail.com sent from admin@qnews.link. I do want to only have there traces to qnews.link and not admin.rav.ovh (marked in red).

What should I change in my configuration to remove red text from sent emails? Sorry for strange formatting, below is a full email text from gmail:

Delivered-To: gmailaccount@gmail.com
Received: by 2002:a05:612c:2689:b0:2ae:8ba9:c9f0 with SMTP id gq9csp3865336vqb;
        Tue, 17 May 2022 11:13:29 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJyIuQgpjhfxKV15spbeCfkHj5v9kiXIHbbTGhyCgJ3/e8hRTo743UT5eTsQjjkC9w7wc9s/
X-Received: by 2002:a5d:6701:0:b0:20c:dc44:f7e7 with SMTP id o1-20020a5d6701000000b0020cdc44f7e7mr19156504wru.484.1652811208868;
        Tue, 17 May 2022 11:13:28 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1652811208; cv=none;
        d=google.com; s=arc-20160816;
        b=MTdvntBPMlJ4Z6L2Vx1WUHrOb5/wtlwHxXZzgf+fHelwK2tpoxDAEKZt6Wa3nrjStf
         PSmRn3pj3aT2hsY9XUReapSZbTChNtnwnYGqzB2bkPKijN951Ac1pFI9ejdOpQJuUpSs
         ++t2Maqdax3SnQMNbLZ84zTw8oCcYTmMqJP8g4zhghGM1fSYjL2C4IlqnrcTVyVSQbgs
         2ClRFDPa5vnZZZd9LtSNbaOUikugzRNdPlugXtb0UoeHF+2dn7f1tj6Xb2KAlLddWcI9
         jhZR8KH7HbAxWvTt92TrxTo5i88eDI3ktF1apa0ZCwUcyqxksIeoDZXZA+Bco7ywocUW
         sWPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:subject:from:to:content-language
         :user-agent:mime-version:date:message-id:dkim-signature;
        bh=VJ4BywFzs85BfE5v2uFrJhzVO48BvRX0Fa/RDMHa+30=;
        b=Hbl8hOv6CQcw63OFKQBOjZMxR0CaOZg140lnrsmAtjFb2TWtn0rF+N+lvmFtvTpwmY
         8TS1eJMZufIOmC5h2QbckmLtF77ZJBz88jdWHk7c9dkccJqmrX+DhCMiBvlQdGjunyvn
         U/1LLQZkJxg1Q/PbWgpt4n2FW6m4eUuhLib3AbQI6C7yKDocw7BoAet/IBHCWVTYGvFz
         m7KRweaLqTgGTJivXwDiRJ9ortO37pNRqxDCQSNQa86rrqOH36Cti0deSKukrLZUpjqZ
         InNTNZGd2E9Sdy3b5hftnBSWWvSCiRc+7XfhatXpj12Nhq3sijYcAUU9qTXwP7FEwd+T
         d+LQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@qnews.link header.s=dkim header.b=kmWY7dSy;
       spf=pass (google.com: domain of admin@qnews.link designates 146.59.79.25 as permitted sender) smtp.mailfrom=admin@qnews.link;
       dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=qnews.link
Return-Path: <admin@qnews.link>
Received: from mail.qnews.link (mail.qnews.link. [146.59.79.25])
        by mx.google.com with ESMTPS id a1-20020a056000188100b00207b2bb996asi18800662wri.830.2022.05.17.11.13.28
        for <gmailaccount@gmail.com>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 17 May 2022 11:13:28 -0700 (PDT)
Received-SPF: pass (google.com: domain of admin@qnews.link designates 146.59.79.25 as permitted sender) client-ip=146.59.79.25;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@qnews.link header.s=dkim header.b=kmWY7dSy;
       spf=pass (google.com: domain of admin@qnews.link designates 146.59.79.25 as permitted sender) smtp.mailfrom=admin@qnews.link;
       dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=qnews.link

Received: from admin.rav.ovh (admin.rav.ovh [127.0.0.1]) by admin.rav.ovh (Postfix) with ESMTP id 4L2kkw0Gwnz3sxl for <gmailaccount@gmail.com>; Tue, 17 May 2022 18:13:28 +0000 (UTC)
Authentication-Results: admin.rav.ovh (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=qnews.link
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=qnews.link; h= content-transfer-encoding:content-type:subject:from:to :content-language:user-agent:mime-version:date:message-id; s= dkim; t=1652811207; x=1653675208; bh=VJ4BywFzs85BfE5v2uFrJhzVO48 BvRX0Fa/RDMHa+30=; b=kmWY7dSy4y0tN3c9qB5UOrmpDAgnBXskiLuH/ZL5C0w ubO9RnmDvT2QThhxhSvzkdg7nraBCPYQvFdfICEVQjkZorJFP1N7RgZ5YfjVNPTw 6cC5Z3DMwc81v0IidBsGEaRcnGBLx+H/zT8iYcU7K0yA6nwpBifD5PkRzO66ot0G NYwGwEvn5Af3y0lDTHeHKzdLdoJaqnK0kfamHbg7DrI1l1GBACNhgMdc6oQEEhy6 P5SLXt1kEqm7mgvEolccytwr2J2AoO4kHuSv1jhLab9nXV9GFqH15U+us5oZMIuH UK5J7xJue3/uigCLbCvHZCjhXe+Y51J8ONI+RONQ9+Q==
X-Virus-Scanned: Debian amavisd-new at admin.rav.ovh
Received: from admin.rav.ovh ([127.0.0.1]) by admin.rav.ovh (admin.rav.ovh [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LUTc9ePHpYi0 for <gmailaccount@gmail.com>; Tue, 17 May 2022 18:13:27 +0000 (UTC)
Received: from [10.8.8.3] (unknown [194.150.167.41]) by admin.rav.ovh (Postfix) with ESMTPSA id 4L2kkv2sNLz3sxg for <gmailaccount@gmail.com>; Tue, 17 May 2022 18:13:27 +0000 (UTC)

Message-ID: <0a1c330b-dd7d-35b0-b8d4-09da0f019b2a@qnews.link>
Date: Tue, 17 May 2022 20:13:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0
Content-Language: en-US
To: gmailaccount@gmail.com
From: admin <admin@qnews.link>
Subject: test email subject
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

test email body line 1

test email body line 2

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team.

2

Re: How to remove hostname from "Received" header in sent emails?

You can define a header check rule to remove it, parameter "header_checks =" in Postfix /etc/postfix/main.cf.