Bounce and error codes

Undelivered Mail Returned to Sender: where the reason is in a Postfix bounce

Last updated 2026-09-08

Undelivered Mail Returned to Sender is the subject line Postfix puts on a bounce, and every Postfix server in the world sends the same one. The reason is further down, on the line that starts with said:, quoted from the server that refused the message. This page shows where that line is and what each reply means.

What it means. A Postfix server, usually your own or your provider's, could not deliver the message and stopped trying. It mailed the original back to you with the refusal quoted.

What to change. Read the said: line. A 5.1.1 is the recipient's address. A 5.7.x naming authentication, SPF, DKIM or DMARC is your sending domain's DNS. A 4.x.x was retried until the queue gave up.

When it clears. When you fix what the reply said and send once more. Postfix will not retry a message it has bounced.

Is this a scam? No, if it quotes a message you sent. Real Postfix bounces come from MAILER-DAEMON at your own server. A bounce for a message you never sent is backscatter, covered at the end.

Anatomy of the bounce

The top of the body is the template. Every word of it is fixed, so nothing here is about your message:

From: MAILER-DAEMON (Mail Delivery System) Subject: Undelivered Mail Returned to Sender This is the mail system at host mail.example.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system

The hostname on the first line is the server that gave up. It's the server your mail client or application handed the message to, not the one that refused it.

Under that comes one paragraph per failed recipient. This is the part to read:

<user@example.net>: host mx.example.net[203.0.113.5] said: 550 5.1.1 <user@example.net>: Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command)

Four pieces. The address in angle brackets is the recipient that failed. The host and IP are the server that refused. Everything after said: is that server's reply, quoted word for word. The bracketed note at the end says which step of the conversation the refusal came at.

RCPT TO or end of DATA: which step refused

That final bracket is the most useful thing in the notice, and almost nobody reads it.

(in reply to RCPT TO command) means the receiver refused when your server named the recipient. At that point it hadn't seen the message. It had seen your server's IP, the sender address in the envelope, and the recipient. So the refusal is about one of those three: the address doesn't exist, your IP is on a blocklist, or SPF failed for the envelope sender.

(in reply to end of DATA command) means the receiver took the whole message and then refused it. That's where DKIM is verified, where DMARC is evaluated against the From header, and where spam and content filters run. A DMARC rejection is always here, because DMARC needs the From header and the header arrives with the data.

(in reply to MAIL FROM command) is rarer and means the receiver refused the sender address itself, usually because its domain has no DNS.

The attached delivery report

The same information is attached in machine-readable form as a message/delivery-status part. Mail clients show it as an attachment or a second section. It looks like this:

Reporting-MTA: dns; mail.example.com X-Postfix-Queue-ID: 4XkQ2p1sGxz3dT9 X-Postfix-Sender: rfc822; you@example.com Arrival-Date: Thu, 4 Sep 2026 09:12:41 +0000 (UTC) Final-Recipient: rfc822; user@example.net Original-Recipient: rfc822;user@example.net Action: failed Status: 5.1.1 Remote-MTA: dns; mx.example.net Diagnostic-Code: smtp; 550 5.1.1 <user@example.net>: Recipient address rejected: User unknown in virtual mailbox table

Status is the code to match against. Diagnostic-Code is the same reply as the said: line. X-Postfix-Queue-ID is the handle for the next section, if you have a shell on the server.

With shell access: follow the queue ID

Take the queue ID from the report and search the log. On Debian and Ubuntu that's /var/log/mail.log, on Red Hat systems /var/log/maillog, or the journal.

grep 4XkQ2p1sGxz3dT9 /var/log/mail.log

Every attempt is there, with the reply the receiver gave each time. For a message that was retried, the log has the original 4xx reply that started the delays, which the bounce doesn't quote. For a message that's still queued, postqueue -p lists it and postcat -q with the ID prints it.

Match the reply to the fix

  • 5.1.1, User unknown, does not exist. The address. Check it against what the person gave you. 550 5.1.1 has the Postfix, Exchange and Gmail wordings.
  • 5.7.26, unauthenticated, SPF or DKIM did not pass. A Gmail recipient found no authentication for your From domain. 550-5.7.26.
  • 5.7.1 with DMARC in the text. The receiver enforced your own DMARC policy. Rejected per DMARC policy.
  • 5.7.1, 554, blocked using, Spamhaus, Barracuda. The connecting IP is on a blocklist, or the receiver's filter refused the message. 554 5.7.1.
  • SPF permerror, too many DNS lookups. Your SPF record is over the limit and fails for every sender. The permerror page.
  • Host or domain name not found, Name service error, type=MX. The recipient's domain has no mail server in DNS. Usually a typo in the domain.
  • Connection timed out, Connection refused. The receiving server is down, or a firewall is in the way. Postfix retried for the queue lifetime first.
  • mail for example.com loops back to myself. Your own server. The domain's MX points at this host but the host isn't configured to accept its mail.

Anything starting 5.7 that names SPF, DKIM or DMARC is a DNS problem at your sending domain, and it's failing for every message from that system, not only this one. Check the domain in your From address with the SPF checker and the DMARC checker. Hard bounce vs soft bounce sorts the whole code space by who owns the fix.

Delayed Mail: the notice before this one

For a temporary refusal Postfix keeps the message and retries. If the admin set delay_warning_time, you get an earlier notice with the subject Delayed Mail (still being retried). By default that setting is off, so the first thing you hear is this bounce, five days after the message left. Read the said: line the same way. The reply it quotes is the last one Postfix got, and the log has the rest.

Bounces for mail you never sent

Postfix addresses a bounce to the envelope sender of the failed message. If someone forges your address into the envelope of their spam and a receiver refuses it, the refusal comes to you. The attached original is the spam, not anything you wrote. Your server wasn't involved, and the notice is backscatter.

You can't stop other servers doing that. You can make forging your domain less useful with a DMARC record at p=reject, which asks receivers to refuse mail that puts your domain in the visible From without passing authentication. The bounces that stop are the ones from receivers that check.

After the fix

One recipient's server sent this bounce. Most receivers don't bounce a failing message at all. They accept it and file it in spam, and the only record of that is the DMARC aggregate reports they send to the address in your DMARC record. Our weekly digest reads those reports and lists every server that sent as your domain and whether it passed. On a paid plan we email you the day an unfamiliar sender first fails. Your first domain is free.

Hear about the next failing sender first

This rejection named one sender, and the next to break sends no warning ahead of it. On a paid plan, the first failing report from a new source reaches you as an email that day, not in Monday's digest. Starter watches 3 domains for $19 a month.

Get the alerts and the digest

No card · Per-source totals kept for life · The free plan does not expire

Questions

What does Undelivered Mail Returned to Sender mean?

A Postfix mail server gave up on delivering your message and mailed it back with the reason attached. The words are Postfix's default subject line, so they tell you the software and nothing else. The reason is the line in the body that ends in reply to RCPT TO command or in reply to end of DATA command.

Which server sent me this bounce?

The one named in the first line of the body: This is the mail system at host followed by a hostname. Usually that is your own outgoing server or your provider's. The server that actually refused the message is the one after the word host in the said: line, with its IP in brackets.

Why does it say in reply to RCPT TO command?

The refusal came at the point where your server named the recipient, before any of the message was sent. That means the receiver refused the address, the sending address, or the connecting IP. A refusal in reply to end of DATA command came after the whole message was sent, which is where DKIM, DMARC and content filters run.

How long did Postfix try before giving up?

For a temporary refusal, five days by default. The setting is maximal_queue_lifetime and the value is 5d unless the admin changed it. A permanent refusal, any reply starting with 5, is bounced on the first attempt.