Articles in this section

Inbound email is bounced back: mail for example.com loops back to myself

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • Email sent to a domain that uses external mail and has the local mail service disabled is bounced with the following error in /var/log/maillog

    postfix/smtp[19079]: 408755E04C2: to=john.doe@example.com, relay=none, delay=0.14, delays=0.14/0/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)

  • This domain's MX record won't resolve, and its A record points to Plesk

    # host -t MX example.com
    example.com has no MX record
    # host example.com
    example.com has address 192.0.2.2
    # hostname -I
    192.0.2.2

  • The right MX record is returned when using a different DNS server

    # host -t MX example.com 1.1.1.1
    Using domain server:
    Name: 1.1.1.1
    Address: 1.1.1.1#53
    Aliases:

    example.com mail is handled by 10 externalmail.example.com.

Cause

Postfix (the mail delivery service) tries to connect to itself because the DNS server returns the wrong IP address when the affected domain is queried.

Resolution

  1. Connect to the server over SSH

  2. Open /etc/resolv.conf for editing

  3. Change the nameserver in /etc/resolv.conf to a valid DNS server, such as 1.1.1.1

    Note: If an external program manages this file, such as NetworkManager or resolvconf, configure it following its documentation to prevent changes to it.

    # cat /etc/resolv.conf
    nameserver 1.1.1.1

  4. Remove localhost and/or 127.0.0.1 if either is configured as a nameserver in /etc/resolv.conf

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.