• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue hostname set correctly, but still localhost.localdomain in email source

obendev

Basic Pleskian
Hey, all of my output is as expected. The hostname is set, main.cf is also set correctly, there is no mailname file and 'hostnamectl status' also outputs the correct hostname.
When I telnet my IP, I also get the correct hostname.
I made sure to follow all these steps: Mail is not working properly on a Plesk server: incorrect hostname is used

But in the source of the actual E-Mail, there's still a part which says: 'Received: from localhost (localhost.localdomain [127.0.0.1]) by plesk.example.tld (Postfix)'

This is the actual E-Mail

Code:
Return-Path: <[email protected]>
Received: from plesk.example.tld ([78.46.0.0]) by mx.kundenserver.de (mxeue009
[212.227.15.41]) with ESMTPS (Nemesis) id 1M267l-1jOR0i38zx-002a8w for
<[email protected]>; Tue, 21 Apr 2020 16:26:09 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
    by plesk.example.tld (Postfix) with ESMTP id 61C1314A1545
    for <[email protected]>; Tue, 21 Apr 2020 16:26:09 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.tld; s=default;
    t=1587479169; bh=KCuoaYOtXeygVkx2ABhjX8czcFfYmnR5cejhTZ0RjJY=;
    h=Received:Received:Subject:From:To;
    b=dUkitjE5OP4Cfqq0wr3mU7wIXKaUB7HgKDkEDWdawNmgVCY3JMTUlgNsL/jvcckUI
     mruiKIMF9pnEN4Y78bbnQppcxt1wg70lhpsSu93vLKSP2ffqXAcqOZlM/ALN5DFoa3
     OLixuk6nHFP6SQYaG+/jEQAmkUG+0r5G2kReFO+w=
Received-SPF: pass (plesk.example.tld: localhost is always allowed.) client-ip=127.0.0.1; [email protected]; helo=localhost;
X-Spam-Flag: NO
X-Spam-Score: -1.191
X-Spam-Level:
X-Spam-Status: No, score=-1.191 tagged_above=-9999 required=3
    tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
    DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001,
    T_FILL_THIS_FORM_SHORT=0.01] autolearn=ham autolearn_force=no
Received: from plesk.example.tld ([127.0.0.1])
    by localhost (example.tld [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id KV8KmPfaLLpi for <[email protected]>;
    Tue, 21 Apr 2020 16:26:06 +0200 (CEST)
Received: from www.senderWebsite.tld (mail.deitron.de [213.221.110.210])
    by plesk.example.tld (Postfix) with ESMTPSA id 23B9F14A1543
    for <[email protected]>; Tue, 21 Apr 2020 16:26:06 +0200 (CEST)
Received-SPF: pass (plesk.example.tld: connection is authenticated)
Message-ID: <[email protected]>
Date: Tue, 21 Apr 2020 14:26:06 +0000
Subject: Subject
From: [email protected]
Reply-To: [email protected]
To: [email protected]
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
X-Mailer: Contao Open Source CMS
Envelope-To: <[email protected]>
X-Spam-Flag: NO
(I changed the true IPv4 and IPv6 address for obvious reasons)

Plesk Obsidian v18.0.27_build1800200522.12 os_Ubuntu 18.04
Plesk Email Security 1.0.5-184
 
Last edited:
Okay so I added the following line to the file /etc/amavis/conf.d/50-user
Code:
$localhost_name = $myhostname;
And this changed at least something.
Before (Without the added line to amavis config):
Code:
Received: from localhost (localhost.localdomain [127.0.0.1])
    by plesk.example.tld (Postfix)
After (With the added line to amavis config):
Code:
Received: from plesk.example.tld (localhost.localdomain [127.0.0.1])
    by plesk.example.tld (Postfix)
My /etc/hosts file:
Code:
127.0.0.1       localhost.localdomain localhost
78.46.0.0       plesk.example.tld plesk

::1     localhost.localdomain localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
2a01::2 plesk.example.tld plesk
(I changed the true IPv4 and IPv6 address for obvious reasons)

Plesk Obsidian v18.0.27_build1800200522.12 os_Ubuntu 18.04
Plesk Email Security 1.0.5-184
 
hello,

i have same problem, i have try myhostename with better result. but always same error
SPF Failed for IP - 127.0.0.1

after install kolab mail security
my orignal header

From [email protected] Wed Aug 24 09:27:42 2022
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from np-z.com (mailserver.domain.tld [42.42.42.42])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by tools.mxtoolbox.com (Postfix) with ESMTPS id 45F59BBB27
for <[email protected]>; Wed, 24 Aug 2022 09:27:42 +0000 (UTC)
Received: from mailserver.domain.tld (localhost.localdomain [127.0.0.1])
by mailserver.domain.tld (Postfix) with ESMTP id BBD18234045A
for <[email protected]>; Wed, 24 Aug 2022 11:27:40 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=np-z.com; s=default;
t=1661333260; bh=p2v58H6Ef2TjmyXyb/xGWg/OWEsrHA5cGQgP7ccMA4o=;
h=Received:Received:Received:From:To:Subject;
b=CX6OzHoEdyOy7h/Vx1RJ/l6NX9jg451ADKZnp+y0MhYKQh9/yK05XCu5NXDTGBYyD
SyktyDjetNjegBm5UkVbK8aLiTRi+rKynym/7YAOvfCxrY3ofp7OmGEsZQ4o0oGD5r
O/JaWg2oNV8kH8/eZllGx0CxV2NFELl+XpZb1kw8=
Authentication-Results: mailserver.domain.tld;
spf=pass (sender IP is 127.0.0.1) smtp.mailfrom=[email protected] smtp.helo=mailserver.domain.tld
Received-SPF: pass (mailserver.domain.tld: localhost is always allowed.) client-ip=127.0.0.1; envelope-from=[email protected]; helo=mailserver.domain.tld;
X-Virus-Scanned: Debian amavisd-new at mailserver.domain.tld
X-Spam-Flag: NO
X-Spam-Score: -2.11
X-Spam-Level:
X-Spam-Status: No, score=-2.11 tagged_above=-9999 required=3
tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001,
NO_RELAYS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mailserver.domain.tld ([42.42.42.42])
by mailserver.domain.tld (mailserver.domain.tld [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id EW2nKmQ1339I for <[email protected]>;
Wed, 24 Aug 2022 11:27:40 +0200 (CEST)
Received: by mailserver.domain.tld (Postfix) with ESMTPSA id E00DE234040C
for <[email protected]>; Wed, 24 Aug 2022 11:27:39 +0200 (CEST)
Received-SPF: pass (mailserver.domain.tld: connection is authenticated)
Received: (Authenticated sender: [email protected])
by nethserver.np-z.com (Postfix) with ESMTPA id 96687EB6B64A
for <[email protected]>; Wed, 24 Aug 2022 11:27:39 +0200 (CEST)
From: "k.zieger" <[email protected]>
In-Reply-To: <182549629690410.1661328643.686043977737427-29915-crm.lead@www>
Content-Type: multipart/alternative;
boundary="----=_=-_OpenGroupware_org_NGMime-14983-1661333259.351118-0------"
X-Forward: 192.168.50.192
Date: Wed, 24 Aug 2022 11:27:39 +0200
To: "mxtoolbox" <[email protected]>
MIME-Version: 1.0
Message-ID: <3a87-6305ef00-1-d2723a0@250341468>
Subject: =?utf-8?q?Re=3A?= test212112332312
User-Agent: Mail 5.6.0
X-PPP-Message-ID: <[email protected]>
X-PPP-Vhost: np-z.com
 
But in the source of the actual E-Mail, there's still a part which says: 'Received: from localhost (localhost.localdomain [127.0.0.1]) by plesk.example.tld (Postfix)'
That is a correct behaviour.
I suppose you sent the mail using Webmail.
Try configuring a mail client and send from there... you will get different headers.
That header just says the origin of the mail and since you used Webmail localhost is correct.
 
That is a correct behaviour.
I suppose you sent the mail using Webmail.
Try configuring a mail client and send from there... you will get different headers.
That header just says the origin of the mail and since you used Webmail localhost is correct.
ok jes, but mxtoolbox sayed bad delivery.
spf failed and dkim failed.
i m not shure why, because the problem are after email security.

SPF Failed for IP - 127.0.0.1 and
DKIM Signature Did Not Verify


and how can edit first post in the forum? its not possible _ _"
 
I am having this same issue. All of my primary domains, show the localhost in the received. I have the PTR set to their ip address, and that throws flags on the receive side. It’s only for the servers Primary Domains. How can I fix that. Do I need to set up a sub domain, and use it.
 
I would like to use just one domain for my emails and configure all other domains to use that domain for incoming and out going. I would do mail.domain.com but it appears that Plesk uses that, to magically get all the domains on a server, to work. But, I have an extra domain name, and could use it just for emails. I also have extra ip’s, a it would be on a dedicated ip.

Should I do that. The other domains emails work, and I have a ptr record for them, and my rdns pointing to their domain name. For email host.

Auto Connect works good, even on iPhones. So, I really don’t want to re-invent the wheel, so to say.

But, my primary domains each have the first mentioned, issue. I have combed the web and this community for help. And, I could not find anything to resolve the issue. I have been attempting to get emails to working correctly for a week, and now I am at the end of the rope, so I have to bug you guys. :) thanks in advance.
 
Back
Top