550 5.7.512: Microsoft needs a valid From header

550 5.7.512Access denied, message must be RFC 5322 section 3.6.2 compliantPermanent: retrying will not helpFrom Microsoft 365 and Outlook.com

Example
550 5.7.512 Access denied, message must be RFC 5322 section 3.6.2 compliant

What it means

RFC 5322 section 3.6.2 defines the originator fields, and says every message must carry a From header with at least one mailbox. Exchange Online enforces that strictly: if the header is missing, empty, or malformed, it rejects the message with 5.7.512.

Note that this is about the header From that people see, not the envelope MAIL FROM used by SPF. A message can pass SPF and still bounce here. It also differs from 5.7.509, where the From domain exists but fails DMARC.

You will mostly see it from scripts, monitoring tools, printers, and home made apps rather than mail clients, because real clients always build a proper From header.

Likely causes

  • The application sets only the envelope sender and never writes a From header.
  • The From header has a display name but no address, for example `From: Alerts`.
  • The address is not in angle brackets when a display name is used, or contains unquoted special characters.
  • A gateway or filter rewrote headers and broke the From line.

How to fix it

  1. Save a copy of the outgoing message and look at its raw header block.
  2. Make the From header a complete address, for example `From: "Monitoring" <alerts@example.com>`.
  3. If your library offers separate "from" and "sender" fields, fill in the header From explicitly instead of relying on defaults.
  4. Check that any relay or filter in the path does not strip or rewrite the header, then resend.

Checks that apply

  • Email Header Analyzer Paste the raw message and the analyzer shows whether a From header exists and how it parses.
  • DMARC Check Once the From domain is valid, DMARC uses it for alignment, so check that domain’s policy before you resend.

The classification runs without network lookups and we never store your paste.

FAQ

My script mail worked for years, why does it fail now?
Microsoft tightened RFC 5322 checks on inbound mail, so messages that were tolerated before are now refused.
Does the recipient’s admin have a setting to allow these messages?
Do not count on one. The reliable fix is to send a correctly formed From header.

Microsoft 365 delist portal Outlook.com SNDS

All 191 bounce codes