551
SMTPERRORCommonDelivery FailureHIGH confidence
User not local; please try <forward-path>
What this means
The 551 code indicates the recipient is not on the local server and, unlike the 251 code, the server is unwilling to forward the message. The client must disconnect and try the suggested forward-path itself.
Why it happens
- 1The server is not configured as a mail relay for the target domain.
- 2A security policy prevents the server from forwarding mail to the specified address.
- 3The client specified a source-routed address, which is discouraged and often blocked.
How to reproduce
A client tries to relay mail through a server that is not authorized to handle it.
trigger — this will error
trigger — this will error
RCPT TO:<user@another-domain.com> 551 5.7.1 User not local; please try <mail.another-domain.com>
expected output
551 User not local
Fix
Use the correct mail server
WHEN When you control the sending application
Use the correct mail server
// Use DNS MX records to find the correct server for the recipient domain
const mxRecords = await findMxRecords("another-domain.com");
connectTo(mxRecords[0].exchange);Why this works
Connecting directly to the recipient's designated mail server is the correct way to deliver mail and avoids relaying issues.
What not to do
✕ Ignore the suggested forward-path
The server is providing an explicit instruction. Ignoring it will only result in failed delivery.
Sources
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev