How does Postfix format DSNs?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

You're debugging a Postfix bounce, and you need to understand what all those fields actually mean. Postfix follows a standard format (RFC 3464) that's pretty consistent, which is good news for parsing.

A Postfix bounce arrives as an email with three parts. The first part is human-readable text explaining what went wrong. The second part is machine-readable metadata about the failure (this is where the real data lives). The third part is the original message headers or full message that bounced.

The human part usually starts with a header like "From: MAILER-DAEMON@your-domain.com" and includes a timestamp and queue ID. That's helpful for tracking, but the technical details you need are in the second part.

The machine-readable section uses standard fields that parsing tools look for. Look for "Status:" (the code, like 5.1.1). Look for "Diagnostic-Code:" (the detailed reason). Look for "Final-Recipient:" (which address actually failed). These three fields tell you almost everything you need to know.

An example: Status might be "5.1.1" (user doesn't exist), Diagnostic-Code might say "X-Postfix; user unknown", and Final-Recipient shows the actual address. That combination is your bounce signature.

The practical approach: If you're parsing Postfix bounces in bulk, your code should target these specific fields. Most email infrastructure tools already know the RFC 3464 structure, so you're not inventing anything new. If you're reading them manually, jump straight to those three fields and ignore the noise. (RFC standards are boring but trustworthy.)

Next: Use our header analyzer tool to paste a real Postfix bounce and see the fields extracted automatically.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Decode Postfix bounce messages like a pro

I'm parsing Postfix bounce messages and I need to understand the structure so I can extract the key fields (like what the actual error is and which address failed). Walk me through what the different parts of a DSN mean and which fields I should focus on.

Edit the yellow boxes, then send to the AI of your choice.