What the message looks like
postfix/smtp[1822]: 7B2C14A0F3: to=<info@example.com>, relay=none, delay=0.1, status=bounced (mail for example.com loops back to myself)Common causes
- The MX record of the domain points to this server, but the domain is not in
mydestinationorvirtual_mailbox_domains. - A
relayhostor atransportentry sends the domain to a host name that resolves to this same machine. - The MX host name or the
relayhostresolves to an address of this server, for example after a move or a changed DNS record. - The domain sits in both
mydestinationand a virtual domain list, ormyhostnamediffers from the name in the MX.
Check
- What are the MX records of the domain?
- What do the MX hosts resolve to?
dig +short A mail.example.com - Which addresses does this server have?
ip -brief address - Routing and domain settings
postconf -n | grep -E 'myhostname|mydestination|relayhost|virtual_mailbox_domains|transport_maps'
Fix
- If this server should receive mail for the domain, add the domain to
virtual_mailbox_domains(or tomydestination), but to one list only, and define where the mailboxes are. - If another server should receive it, correct the MX record to point there, and remove the entry in
transport_mapsor therelayhostthat points back to this machine. - Make
myhostnamematch the real host name, and check that no name in the routing resolves to your own IP unless intended. - Apply with
postfix reload, then retry the stuck messages withpostqueue -f. - Send a test mail and watch
journalctl -u postfixto see the delivery.
FAQ
What is the difference to a hop count exceeded bounce?
Hop count exceeded (554 5.4.14) appears after a mail has travelled around a loop between servers. Loops back to myself is caught earlier, on the first lookup.
Does a backup MX cause this?
It can. A secondary MX that you list for a domain must be set up as a relay for it (relay_domains with a transport), or it will refuse or loop the mail.