Plesk

How to run Postfix on multiple SMTP ports on a Plesk server

Question

How to run Postfix on multiple SMTP ports on a Plesk server?

Answer

In this example, an alternate SMTP port 2525 is added in addition to default SMTP port 25.

Note: The master.cf file may be overwritten by Plesk update/upgrade.

  1. Connect to a Linux server via SSH.

  2. Create a backup file of the current master.cf file:

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

  3. Open the file /etc/postfix/master.cf in any text editor. In this example, we are using the vi editor:

    # vi /etc/postfix/master.cf

  4. Add a line with a new SMTP port like this:

    ==========================================================================
    # service type  private unpriv  chroot wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)  (never) (100)
    # ==========================================================================
    smtp      inet  n       -       y      -       -       smtpd
    2525      inet  n       -       y      -       -       smtpd

  5. Save the changes and close the file.

  6. Restart Postfix to apply the changes:

    # service postfix restart

  7. Verify that the new the SMTP port is listening:

    # netstat -plutn | grep 2525
    tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN 2996/master
    tcp6 0 0 :::2525 :::* LISTEN 2996/master

  8. If a firewall is enabled on the server, make sure the new port is opened in firewall configuration.