• 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

Resolved eMail Security: Issue with hostname (not valid)

floh

Basic Pleskian
Server operating system version
Debian 10.13
Plesk version and microupdate number
18.0.49 Update #2
Hi everybody.

I'm running Plesk Obsidian on my Proxmox-Machine as a Container. Everything works well except eMail Security which I'd like to setup.

Unfortunately I only get an error message there:
Hostname ist nicht valide. Der aktuelle Wert ist "hosting". Plesk Email Security funktioniert nur mit einem validen Hostnamen. Bitte eine hierarchische, durch Punkte getrennte Domain als Hostnamen angeben!
Which means in English:
Hostname is not valid. The current value is "hosting". Plesk Email Security only works with a valid hostname. Please set a hierarchial, dot-separated domain as the hostname!
But if I doublecheck on Dashboard-Page, there is full hostname with domain. Where exactly does eMail Security get the value as hostname?

This is my /etc/hosts (my actual domain name is masked by "example.com" here for security reasons. The masked IP-Address in PVE section is local IP-Address managed by Proxmox.)
Code:
127.0.0.1    localhost.localdomain localhost hunxxxx.xxx-xxx-xxx-xxx.plesk.page hunxxxx hosting.example.com hosting
::1    localhost.localdomain localhost ip6-localhost ip6-loopback   
ff02::1    ip6-allnodes   
ff02::2    ip6-allrouters   
# --- BEGIN PVE ---
xx.xx.xx.xx hosting.example.com hosting
# --- END PVE ---

Any ideas?

Best regards
Floh
 
Yes, give this a try. If this disturbs other services (unlikely) you can add it again.
 
Just to be sure, do I need to restart anything after I changed the hosts file? The problem is, after I removed "hosting" Proxmox readd it to hosts when I reboot the container.
 
For the server itself there is no need to restart anything. What other stuff does that is working around or above the server I do not know.
 
Hi, removing 'hosting' from the hosts file, as suggested by Peter, did not help unfortunately. Do any of you have an idea how to fix this issue? Does anyone know where Plesk retrieves the hostname value from?
 
Is the correct hostname set in Tools & Settings > General > Sever Settings > Full Hostname?
 
I've tried that, but after reboot the domain is removed by Proxmox. I asked them in their forum and this is reply with a quote:
The FQDN (Fully Qualified Domain Name) of the system is the name that the resolver(3) returns for the host name, such as, ursula.example.com. It is usually the hostname followed by the DNS domain name (the part after the first dot). You can check the FQDN using hostname --fqdn or the domain name using dnsdomainname.

So they wrote:
the hostname is not the FQDN.
See more: Proxmox Forum - "FQDN as hostname for container"
 
Code:
root@hosting:~# hostname --fqdn
localhost.localdomain
:oops:

That of course is wrong...

If I don't use the --fqdn parameter then its fine:
Code:
root@hosting:~# cat /etc/hostname
hosting
root@hosting:~# hostname
hosting
Why?

UPDATE: I just changed the order of hostnames in /etc/hosts in first line (the one with localhost IP) so the fqdn is placed first before localhost.localdomain.
Now its ok:
Code:
root@hosting:/etc# hostname --fqdn
hosting.example.com
But the eMail Security still complains the same error.

:/
 
If I change the hostname with hostnamectl command, then eMail Security works which is good. But after reboot the hostname is reverted to non-fqdn hostname.
Code:
root@hosting:/etc# hostnamectl set-hostname hosting.example.com
root@hosting:/etc# hostnamectl
   Static hostname: hosting.example.com
         Icon name: computer-container
           Chassis: container
        Machine ID: ********************************
           Boot ID: ********************************
    Virtualization: lxc
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 5.11.22-3-pve
      Architecture: x86-64
root@hosting:/etc# cat /etc/hostname
hosting.example.com
root@hosting:/etc# reboot

# relogin the machine

root@hosting:~# hostnamectl
   Static hostname: hosting
         Icon name: computer-container
           Chassis: container
        Machine ID: ********************************
           Boot ID: ********************************
    Virtualization: lxc
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 5.11.22-3-pve
      Architecture: x86-64

Can't the developer from eMail Security fix it since hostname is not a FQDN but a part of it? Especially Plesk detect the fqdn correctly. (Dasboard -> Overview -> Hostname = hosting.example.com)

Suggestion?
 
I came across similar issue's in these post/questions with different suggested solutions. Perhaps some of those can be helpful for you as well.

 
Amavis needs the fully qualified domain name and it gets it from the `hostname --fqdn` command . You can manually set by using the $myhostname option in the Amavis config.

On Debian/Ubuntu $myhostname is set in /etc/amavis/conf.d/05-node_id:

Code:
use strict;

# $myhostname is used by amavisd-new for node identification, and it is
# important to get it right (e.g. for ESMTP EHLO, loop detection, and so on).

chomp($myhostname = `hostname --fqdn`);

# To manually set $myhostname, edit the following line with the correct Fully
# Qualified Domain Name (FQDN) and remove the # at the beginning of the line.
#
#$myhostname = "mail.example.com";

1;  # ensure a defined return

Setting $myhostname manually to the fully qualified domain name will fix any issues even if gets reset on the OS.
 
Ok, I see. I just found out that Plesk eMail Security uses amavis and there I saw the requirement about the hostname. I tried to set the variable $myhostname same as you suggested, but I don't have /etc/amavis. Could it be be that it's installed after I run the eMail Security first time?

Update: I just tried run the install after I used the 'hostnamectl set-hostname' command. Now there is the directory and I modified the file 05-node_id.
Now testing....
 
I'm using Debian Buster. In the meanwhile I successfully installed the eMail Security. See Post #18

Then I rebooted (so hostname is reverted) and I still can access the eMail Security pages. That is great. Will do some tests if everything is working as expected. So hostnamectl is a workaround to get eMail Service installed but you have to set the $myhostname variable manually.

@danami & previous posters: Thank you for taking your time!
 
Back
Top