Karta. SMTP. DataReader
(Karta v1.0.0)
Reads a DATA section (RFC 5321 §4.1.1.4, §4.5.2).
- The message ends only on a strict
<CRLF>.<CRLF>, where the leading CRLF may be the virtual one at the start of DATA. A bare LF or a bare CR never ends a line, so\n.\r\nand friends cannot smuggle a second message; any bare LF/CR is flagged and the session rejects the message. - A leading dot on a line is removed (dot-unstuffing).
- Bytes past
maxare counted but not stored, so memory stays bounded while we still read up to the terminator and can answer 552.
Summary
Functions
Discards the message: the sink drops what it holds (used when the connection ends mid-DATA).
Feeds bytes. Returns {:done, reader, rest} once the terminator is seen; rest follows it.
Types
Functions
@spec abort(t()) :: :ok
Discards the message: the sink drops what it holds (used when the connection ends mid-DATA).
Feeds bytes. Returns {:done, reader, rest} once the terminator is seen; rest follows it.
@spec finish(t()) :: %{ body: term(), size: non_neg_integer(), too_large: boolean(), bare_newline: boolean() }
@spec new(pos_integer(), module(), keyword()) :: t()