Mail bounces with "Relay access denied" while a second server holds a copy
Why some senders are told "554 Relay access denied" for a domain that works, and how to stop mail being sent to the copy.
A sender reports a bounce such as 554 5.7.1 <address>: Relay access denied for a domain whose mail normally works, and the bounce names your second server (the one holding a copy of the account), not the live one.
What it means
A second server that only holds a copy does not accept mail for that domain, so it refuses it. Senders only go there if DNS tells them to. The usual cause is that the domain's mail host name (for example mail.example.com, the name the domain's MX record points at) lists both servers' addresses. A sender may pick either address, so part of the mail lands on the copy and is refused.
Steps
- Check what the mail host name resolves to. Replace
example.comwith the domain:
Only the live server's address should appear. Do the same fordig A mail.example.com +short dig AAAA mail.example.com +shortwebmail.example.com. - If the second server's address is listed, remove those records where the domain's DNS is managed (the DNS page, or in Cloudflare if the domain is connected to it). Records already published there by an earlier version have to be removed by hand once.
- Run the
digcommands again after a few minutes, and once more the next day to confirm nothing puts the address back.
If you have switched over to the second server on purpose, it takes over the mail and webmail names automatically. See Switching over to a second server.