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:
203.0.113.2 was found to be using the following name as the HELO/EHLO parameter during connections: "localhost.localdomain"
OR
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 [email protected].
-
MX Lookup Tool by MxToolbox may show the following problem:
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:
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: