What is a malformed message?

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

A malformed message is an email that breaks the structural rules laid out in RFC 5322 and MIME standards. Think missing colons in headers, illegal characters, duplicate headers that shouldn't exist, broken MIME boundaries, or contradictory encoding declarations.

Why does this matter? Mailbox providers like Gmail and Outlook will often reject or quarantine malformed messages outright. They look like spam or malware because that's usually what they are. Spammers cut corners, legitimate senders follow the rules.

How does a message become malformed in the first place? Most commonly: ESP bugs (rare but it happens), header injection attempts (security issue), encoding problems when handling international characters, or custom SMTP implementations that didn't read the RFC closely enough. If you're using a mainstream ESP like Mailchimp or Postmark, you're probably fine. They handle the header construction for you.

But if you're building custom SMTP, using an API to construct messages, or letting user input touch email headers, you can absolutely create malformed messages by accident. Common mistakes: forgetting to encode international characters in subject lines (RFC 2047 requires it), inserting newlines into header values without proper folding, duplicating headers like Message-ID or Date, and using non-ASCII characters in header names.

If you suspect you're sending malformed messages, check your email source (View > Show Original in Gmail, or use our Source Analyzer). Look for obvious header breaks, missing colons after header names, or encoding that looks garbled. If you're stuck diagnosing it, ask us. Malformed message errors can be cryptic.

Related: if you're seeing duplicate headers, that's technically a malformed message too. And if you're confused about HTML vs text body structure, that's MIME territory.

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

Not sure if your messages are RFC-compliant?

I read this on the Email Almanac about malformed messages: "A malformed message is an email that breaks the structural rules laid out in RFC 5322 and MIME standards. Examples: missing colons in headers, illegal characters, duplicate headers, broken MIME boundaries, or contradictory encoding declarations. Gmail and Outlook often reject or quarantine these messages because they look like spam or malware." Help me figure out if MY emails might be malformed and how to fix it: 1. How do I check if my messages are malformed? 2. What are the most common mistakes that cause this? 3. If I'm using your ESP, am I safe or do I need to check something? 4. How do I diagnose this if my emails are bouncing or getting blocked? --- My setup: - ESP/platform: e.g. Mailchimp, custom SMTP, API-based sending - Sending custom headers?: yes/no, which ones? - Using custom code to build messages?: yes/no - Handling international characters?: yes/no - Specific error message (if any): paste it here

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