550 5.7.512: message must be RFC 5322 compliant (From header)
550 5.7.512 means Microsoft 365 found no valid address in your message's From header. Add one in name-addr format, quote odd display names, and resend.

On this page(9 sections)
The bounce says "550 5.7.512 Access denied, message must be RFC 5322 section 3.6.2 compliant", and it is aimed at one thing: the From header of your message. Microsoft 365 could not find a valid email address there, so it refused the message before looking at anything else. Your IP, your reputation and your DNS are not the problem.
This guide shows what the header must look like, the handful of mistakes that trigger the rejection, and how to find the broken header in a few minutes.
What does 550 5.7.512 mean?
550 5.7.512 means the message was sent without a valid address in its From header field. Microsoft's NDR reference for Exchange Online lists it as "Access denied, message must be RFC 5322 section 3.6.2 compliant" and explains that each message must contain a valid email address in the From header, with the address in angle brackets, for example <[email protected]>. Without an address in that format, Microsoft 365 rejects the message.
The same Microsoft table marks this one as Office 365 only. Microsoft's neighboring codes are unrelated: 5.7.511 is a banned sending IP (see our 5.7.606 guide), and 5.7.509 and 5.7.515 are DMARC rejections (see 5.7.509 versus 5.7.515).
What is section 3.6.2 of RFC 5322?
Section 3.6.2 of RFC 5322 defines the originator fields: From, Sender and Reply-To. An originator field says who wrote the message and who sent it. The rules that matter here:
- A message must have exactly one From field. It is not optional.
- The From field holds a list of mailboxes, meaning real addresses, each written as
local-part@domain, with an optional display name. - If the From field lists more than one mailbox, a Sender field is also required, naming the one that actually sent it.
The "From" the recipient sees is this header. It is separate from the envelope sender (the MAIL FROM address used during the SMTP conversation). If that distinction is new, read From, Reply-To, envelope sender and Return-Path explained.
What does a valid From header look like?
A valid From header is a display name plus an address in angle brackets, or a bare address. Both of these are fine:
From: "Acme Billing" <[email protected]>
From: [email protected]
Microsoft's guidance is the angle-bracket form with an address inside. A From line that has a name but no address is the single most common cause of this bounce.
Which From headers trigger the rejection?
These are the patterns that break the rule, and what to change for each.
| What the header looks like | Why it fails | Fix |
|---|---|---|
| No From header at all | The field is mandatory | Always set one |
From: Acme Billing |
A name with no address | Add <[email protected]> |
From: <> or From: |
Empty or null address | Use a real mailbox |
From: Acme, Inc. <[email protected]> |
An unquoted comma or period in the display name breaks parsing | Quote it: "Acme, Inc." |
| Two From headers | Only one is allowed | Remove the duplicate |
From: billing@example |
No valid domain | Use a full domain |
| A name with accents or emoji, sent raw | Non-ASCII text in a header has to be encoded | Encode it (RFC 2047) or let your library do it |
The quoting row catches people out. RFC 5322 treats characters such as commas, periods, parentheses and @ as special inside a display name, so a company name like Acme, Inc. has to be wrapped in double quotes. Most mail libraries add the quotes for you if you pass the name and the address as separate fields. Hand-built header strings are where it goes wrong.
How do you find the broken header?
Start from the exact message that bounced, not from your template.
- Read the full bounce. Confirm the code is 5.7.512 and note the recipient domain.
- Get the raw message your system produced. Most senders can log or save it; with SMTP, run a test against a local capture tool and read the headers.
- Find every line that starts with
From:. There should be exactly one. - Check that line against the table above.
- Look at any code that builds the header by string concatenation, especially where a user-supplied name goes in.
A quick checklist before you resend:
- Exactly one From header
- An address with a local part, an
@and a full domain - The address inside angle brackets when a display name is present
- Display names with commas, periods or quotes are wrapped in double quotes, with inner quotes escaped
- Non-ASCII names are encoded, not pasted raw
- No line breaks inside the name from a stray newline in user data
That last point matters. A name pulled from a form field or a CRM that contains a newline can split the header in two. Strip control characters from anything that ends up in a header. It also closes off a header injection hole, which is a security problem on its own.
Why only Microsoft 365?
Other providers may be more forgiving. The 5.7.512 check is Microsoft's, and Microsoft documents it as specific to Office 365. A message with a sloppy From header can still be delivered elsewhere, which is why this bounce often shows up as "only Outlook and Microsoft 365 recipients fail". Do not read the other providers' acceptance as proof the header is fine. Broken headers also break threading, spam scoring and authentication alignment in ways you do not see directly. For the rest of the header block, message-ID and threading headers and MIME structure for developers are useful companions.
Does fixing the From header also fix DMARC problems?
No. A valid From is only the first step. DMARC then compares the domain in that header to the domains that passed SPF and DKIM. If you also see 5.7.509 or 5.7.515, you have a separate authentication problem, and the From header needs the right domain, not just a well-formed one. Check both.
How does this look with Koltrix?
If you send through Koltrix, you pass the sender and recipients as fields and Koltrix builds the message, so you do not assemble the From header by hand. The sender address has to be on a domain you have verified in Koltrix. When you test a fix, send to a Microsoft 365 mailbox and read the bounce, if any. See the docs for the sending API and SMTP relay.
Bottom line
550 5.7.512 is a header formatting rejection from Microsoft 365: the From field has no valid address. Make sure there is exactly one From header, with a real address in angle brackets, a quoted display name when it has special characters, and encoded non-ASCII text. Test against a Microsoft 365 mailbox after the change. If the code is anything else in the 5.7.5xx range, read the code before you change anything, because the fix for each is different.
Start with Koltrix
Your domain, one inbox, and an API that sends.
A team inbox where AI sorts and drafts (nothing is sent without your click), plus the transactional API and SMTP relay your product sends with. 7 days free, no card.

