Plesk

How to change the hostname and SMTP banner in Postfix on a Plesk server

Question

Answer

  1. Connect to a Plesk server via SSH.

  2. For security reasons, create a backup file of the Postfix configuration file main.cf:

    # cp /etc/postfix/main.cf /etc/postfix/main.cf.bak

  3. Open the main.cf file in a text editor. In this example, we are using the vi editor:

    # vi /etc/postfix/main.cf

  4. Add/modify the Postfix configuration parameters myhostname and smtpd_banner the following way:

    myhostname = server.example.com
    smtpd_banner = $myhostname ESMTP $mail_name

    Note: Make sure that other myhostname and smtpd_banner parameters are disabled (contain # at the beginning of the line).

  5. Save the changes and close the file.

  6. Check Postfix configuration syntax:

    # postfix check
    (empty output - means syntax is OK)

  7. Restart Postfix:

    # service postfix restart

Exit mobile version