Visual RFC.
ALL RFCs / RFC 3676
Read the RFC ↗
RFC 3676 / FLOWED PLAIN TEXT

Count quotes before removing one stuffing space

03

A leading SPACE can protect literal text. Quote marks must be counted before that one protective SPACE is removed.

RFC 3676 · § 4.4EXAMPLE
4 / 4
Count quotes before removing one stuffing spaceFour decoded-line examples, all with hard endings. SPACE greater-than SPACE Exit is an unquoted literal greater-than line, depth zero. Two adjacent greater-than signs then one stuffing SPACE produce depth two and Exit content. Greater-than SPACE greater-than SPACE Exit has depth one; after unstuffing, the remaining greater-than is content and is not counted again. From and indentation examples remove exactly one protective SPACE. No sender identity is authenticated.Quote test → one-space unstuff␠From␠garden↵count only initial > marksQuote depth: 0Content: From␠garden␠␠indented → ␠indented␠ = SPACE · ↵ = CRLF
04
Preserve From and indentation.

Wire SPACE From garden un-stuffs to From garden. Separate indentation example: two leading SPACEs become one content SPACE, not zero.

Source for this drawing: RFC 3676 · Read RFC section 4.4 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

The envelope and the letter do different jobs.

Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Stuffing protects content; it does not add quote depth.

  • On generation, unquoted lines beginning with >, and lines beginning with SPACE or From followed by SPACE, MUST be space-stuffed. Other lines MAY be stuffed.
  • Quote depth is the count of initial > marks. On reception, first count those leading quote marks. Then remove one leading stuffing SPACE from the remaining content, before testing for flowed text. Do not strip every leading space.
  • Each quoted flowed line starts with its quote indicator. >> Exit and >>Exit both have depth2 and content Exit; > > Exit has depth1 and content > Exit.
DETAILS

SPACE is the ordinary space character, not a tab or every Unicode whitespace character. Quoted-line stuffing comes after its quote indicator. The From example explains protection from historical From-munging, not authentication of a sender or SMTP dot-stuffing. The displayed strings are fictional decoded body lines with hard CRLF endings.

Read the RFC section ↗

All chapters in RFC 3676

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗