Applicable to:
- Plesk for Linux
Symptoms
A hostname of a local mail server is localhost.localdomain:
# telnet 203.0.113.2 25
...
220 localhost.localdomain ESMTP Postfix
After changing hostname on the server the system notification are still send from old hostname.
Possible Consequences
-
The IP address of this Plesk server got blacklisted with one of the following messages:
PLESK_INFO: 203.0.113.2 was found to be using the following name as the HELO/EHLO parameter during connections: "localhost.localdomain"
OR
PLESK_INFO: This is the mail system at host localhost.localdomain.
... -
Outgoing emails from this Plesk server are marked as spam or not delivered to Gmail, outlook, Yahoo! Mail, etc.
-
Non-delivery reports come from the address MAILER-DAEMON@localhost.localdomain.
-
MX Lookup Tool by MxToolbox may show the following problem:
CONFIG_TEXT: SMTP Reverse DNS Mismatch Reverse | DNS does not contain the hostname
- Mail servers are rejecting connections / marking as spam emails from the Plesk server because it does not have a fully qualified domain name (FQDN). As a result, the server IP address may be blacklisted.
Cause
Hostname is not configured properly on a server.
Resolution
-
Log into Plesk and go to Tools & Settings > Server Settings and specify a FQDN, then click OK:
Note: Server hostname should be resolved to a Plesk server IP address. If a hostname is unknown, contact your service provider for assistance, or use any domain you own, which points to this server.
-
Connect to the Plesk server via SSH and check that the server hostname is configured in mail server configuration:
Note: To find out which mail server is in use, go to Tools & Settings > Mail Server Settings > Installed mail server
-
If Postfix is used as a mail server:
2.1. Make sure that the
myhostname
parameter is commented with the hash symbol "#" or has a fully qualified domain name:# grep "myhostname =" /etc/postfix/main.cf
#myhostname = localhost.localdomainOR
# grep "myhostname =" /etc/postfix/main.cf
myhostname = server.example.com2.2. If the file
/etc/mailname
exists, make sure a correct server hostname is defined in it:# cat /etc/mailname
server.example.com -
If QMail is used as a mail server:
2.1. Open/create the file
/var/qmail/control/me
in a text editor. In this example, we are using the "vi" editor:# vi /var/qmail/control/me
2.2. Put the same hostname as on step 1:
CONFIG_TEXT: server.example.com
2.3. Restart QMail:
# service qmail restart
-
-
Verify that the server hostname has been changed:
# hostnamectl status | grep 'Static hostname'
Static hostname: localhost.localdomainIf the hostname is still incorrect, change it manually with the command:
# hostnamectl set-hostname server.example.com
-
If the server IP address was blacklisted, contact blacklist owners and report that the hostname has been changed to FQDN. Visit this KB article for details:
Comments
4 comments
Fix does not work.
74.208.165.208 was found to be using the following name as the HELO/EHLO parameter during connections: "localhost.localdomain".
Hostname is set. esaproductmanager.com in GUI
Command Line:
# hostname
esaproductmanager.com
@esa Software, Hi! It means that 'myhostname' parameter is explicitly defined in '/etc/postfix/main.cf' configuration file. Set the required hostname in /etc/postfix/main.cf manually.
I couldn't get this to work on the Google Cloud Platform with Plesk. I did all the steps. Step 3 works for a short time, but it gets reset to the GCP name quickly, after setting. So we still get this error when PHP runs from the command line or cron, unless we run it immediately after the manual host name change. The command line also prints the error (echo '[MESSAGE]' | mail -s [SUBJECT] [EMAIL@EXAMPLE.COM])
We are using sendgrid and the mail actually gets delivered. The messages we see may just be warnings?
@Paul Schmidt According to the following link, the behavior of hostname changing is expected on Google Cloud instances: https://stackoverflow.com/questions/25313049/configuring-fqdn-for-gce-instance-on-startup. So, a script can be set up as described in https://stackoverflow.com/questions/25408612/google-compute-engine-how-to-set-hostname-permanently to change the hostname upon reboot.
Please sign in to leave a comment.