JSOPanel Get started
Help Center › Administrators › Mail bounces with "Relay access denied" while a second server holds a copy

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

  1. Check what the mail host name resolves to. Replace example.com with the domain:
    dig A mail.example.com +short
    dig AAAA mail.example.com +short
    Only the live server's address should appear. Do the same for webmail.example.com.
  2. 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.
  3. Run the dig commands again after a few minutes, and once more the next day to confirm nothing puts the address back.
Tip: current versions no longer add a copy's address to the mail and webmail names, and are designed to answer mail that reaches a copy with a temporary "try again later" instead of a permanent refusal, so the sender retries on the live server. Removing the stray DNS records is still what stops it reaching the copy in the first place.

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.