What is header folding?

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

Header folding is a legacy formatting trick from the early days of email. When a header line got too long (Subject line with lots of characters, or a long list of recipients), the mail system would split it across multiple lines by inserting a line break followed by whitespace. The receiving system would then treat those multiple lines as one continuous header.

But Here's the thing: you don't need to think about header folding anymore. Modern ESPs and email clients handle it automatically. If you're using Mailchimp, SendGrid, Postmark, or any modern platform, they won't create folded headers. They'll send everything as single lines.

Why it still matters: your email client must be able to READ folded headers, even though it shouldn't CREATE them. Some old mail servers still send folded headers, and if your system can't parse them correctly, you might see broken subject lines or recipient lists. This is called "obsolete folding" (obs-fold) in RFC 5322, the spec that defines email format. It's marked obsolete because new systems shouldn't use it, but they still need to understand it for backward compatibility.

The practical impact: if you're building custom email software or working with raw SMTP, be aware that folded headers exist in the wild. When you parse incoming mail, treat a line break followed by whitespace as a continuation of the previous header, not a new one. If you're just sending marketing emails or transactional notifications through an ESP, you don't need to do anything. Your platform handles it.

And if you're debugging delivery issues and see folded headers in your raw email source, that's normal for older systems. It won't cause spam filtering on its own. What WILL cause problems is if your custom code folds headers incorrectly (wrong whitespace, breaking mid-word, or folding headers that shouldn't be folded at all). Mail systems expect folded lines to be treated as continuous text, so incorrect folding can break authentication signatures or cause the receiving server to reject your message entirely.

Want to see what your headers actually look like? Use our Email Header Analyzer to check the raw source. If you're stuck on a delivery issue that might be header-related, ask us and we'll walk through it with you.

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

Get header folding advice for your setup

I read this on the Email Almanac about header folding: "Header folding is a legacy formatting trick from the early days of email. Modern ESPs handle it automatically. Your email client must be able to READ folded headers, even though it shouldn't CREATE them. Folded headers won't cause spam filtering on their own, but incorrect folding can break authentication or cause rejections." Help me understand how this applies to MY specific situation. Based on my setup details below, tell me: 1. Do I need to worry about header folding at all? 2. If I'm seeing delivery issues, could folded headers be the cause? 3. What should I check in my raw email headers? 4. Are there any ESP-specific quirks I should know about? --- My details (the more you share, the better the advice): - Email platform/ESP: Mailchimp, SendGrid, Postmark, HubSpot, custom SMTP, etc. - Are you building custom email software or using an ESP's interface? custom / ESP dashboard - Current challenge: [What prompted this question? Delivery issue? Building something? Debugging?] - Have you looked at your raw email headers? yes/no, and if yes, what did you see?

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