Articles in this section

Mail delivery to an external domain from Plesk server fails: mail loops back to myself

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • Mail to an external domain is not delivered. The following entries can be found in /var/log/maillog :

    # status=bounced (mail for example.com loops back to myself)


    # postfix/smtp[30738]: warning: host mail.example.com[203.0.113.2]:25 greeted me with my own hostname c1.example.com

  • Unable to get root email delivered externally. In /etc/aliases the following entries can be found:

    # tail /etc/aliases
    # Person who should get root's mail
    root: johndoe@example.com

Cause

The remote server thinks that he is sending mail to itself. Possible reasons:

  • IP Address of MX record for recipient's domain points to Plesk server
  • myhostname parameter in /etc/postfix/main.cf is the same on both sender and recipient servers

Resolution

  1. Connect to the server via SSH.

  2. Make sure first that IP address of the recipient's domain does not belong to the Plesk server:

    # host example.com
    example.com has address 203.0.113.2
    example.com mail is handled by 0 example.com.
    # ip a | grep 203.0.113.2
    inet 203.0.113.2/32 brd 203.0.113.2 scope global venet0:0

    On the example above, IP address 203.0.113.2 belongs to sender server. That is why Postfix falls in a loop.

    Correct the DNS setting to resolve the issue. If DNS is handled by a third-party name server, correct DNS settings in Plesk accordingly.

  3. In case IP address does not point to the same server, check myhostname on a source and compare with hostname from the log:

    # postconf | grep myhostname
    myhostname = c1.example.com
    # postfix/smtp[30738]: warning: host mail.example.com[129.168.0.1]:25 greeted me with my own hostname c1.example.com

    If they are equal, it is required to change myhostname in /etc/postfix/main.cf file.

  4. As an additional step, it may be necessary to add a required domain name to mydestination line. It should look as follows:

    CONFIG_TEXT: mydestination = localdomain, localhost, localhost.localdomain, localhost, example.com

    and restart postfix using the following command:

    # service postfix restart

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.