Skip to main content

What is header folding?

Header folding allows long header lines to be split into multiple lines for readability without breaking syntax. It’s done by inserting a line break followed by whitespace.

This technique, called obsolete folding (obs-fold) in RFC 5322, is considered a legacy feature. Folding is still allowed for backward compatibility, and modern clients must be able to read folded headers. However, they should not create new ones—think of it as a read-only rule. A modern message should send headers as a single line, but still be able to understand old folded ones.

Mail systems treat folded lines as continuous text, so fold carefully to avoid capsizing your syntax.