Applicable to:
- Plesk for Linux
Question
-
How to change the hostname in Postfix on a Plesk server?
-
How to change the SMTP banner in Postfix on a Plesk server?
Answer
-
Connect to a Plesk server via SSH.
-
For security reasons, create a backup file of the Postfix configuration file
main.cf
:# cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
-
Open the
main.cf
file in a text editor. In this example, we are using the vi editor:# vi /etc/postfix/main.cf
-
Add/modify the Postfix configuration parameters
myhostname
andsmtpd_banner
the following way:CONFIG_TEXT: myhostname = server.example.com
smtpd_banner = $myhostname ESMTP $mail_nameNote: Make sure that other
myhostname
andsmtpd_banner
parameters are disabled (contain # at the beginning of the line). -
Save the changes and close the file.
-
Check Postfix configuration syntax:
# postfix check
(empty output - means syntax is OK) -
Restart Postfix:
# service postfix restart
Comments
9 comments
Way is my comment deleted?
Hello @Hassan Oumar
The only your comment is in Emails are sent with a wrong hostname in a sender address from a Plesk for Linux server with Postfix article and it was already answered.
Hello.
Does is possible to send a different sender hostname fo each domain that is hosted on a server?
For example the domain domain.com send the SMTP hostname as mail.domain.com and example.com send as mail.example.com and not use a general hostname for example: mail.server.com
Thanks in advance for all your help!
Hello Dennis Molina Arguedas
Please, check the section "Send from domain IP addresses and use domain names in SMTP greeting" in the article https://support.plesk.com/hc/en-us/articles/213905445
Thanks Ivan.
I'll check it.
Thanks for your reply!
However I used a main server name as SMTP name server in order to send all the emails with this sign, with the PTR pointing to the main record.
Best Regards.
Hello, is this fix persistent or it will be wiped out by the first Plesk micro-update? Main.cf file seems to be overwritten pretty often. Thanks.
Thanks Kuzma Ivanov,
Your answer solved my problem with MXTOOLBOX regarding the SMTP Banner check.
Regards
Hello Riccardo Di Roberto
It depends on the changes in a particular update. Indeed, there's a possibility that some updates will wipe manual changes. You may use 3rd-party software to automatically restore changes in main.cf.
What else do I have to change after this? I have existing mail accounts, did your proposed changes. But after that I could not receive mails and senders got the reply, that user "info" (my mail account) does not exist. It seems that plesk maps accounts with the hostname.
thanks for your help in advance
Please sign in to leave a comment.