|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Layer 7 (Application) - the client half of one SMTP session (RFC 5321). More...
#include "protocore_config.h"Go to the source code of this file.
Layer 7 (Application) - the client half of one SMTP session (RFC 5321).
RFC 5321 sec 3.1: an SMTP session is initiated when a client opens a connection to a server and the server responds with an opening message. This module drives that session end to end: the 220 Greeting (sec 4.2), EHLO (sec 4.1.1.1), an optional in-band TLS upgrade (RFC 3207 sec 4), an optional AUTH exchange (RFC 4954 sec 4), the mail transaction MAIL / RCPT / DATA (sec 3.3, sec 4.1.1.2 - 4.1.1.4), and QUIT (sec 4.1.1.10).
What DATA carries is an RFC 5322 message: a From: field (sec 3.6.2), a To: field (sec 3.6.3), a Subject: field (sec 3.6.5), an empty line, and the body (sec 2.1), labeled MIME-Version: 1.0 (RFC 2045 sec 4) and text/plain (RFC 2045 sec 5.1). The body is normalized to CRLF line endings and dot-stuffed (RFC 5321 sec 4.5.2) ahead of the "<CRLF>.<CRLF>" end of mail data indication (sec 4.1.1.4).
::SmtpNs::run walks the dialogue over the byte seam in SmtpNs::transport, so a scripted transport runs the whole exchange on the host. ::SmtpNs::send binds that seam to the outbound client transport (::TcpClient) and blocks until the message is accepted.
Zero heap; every buffer is a compile-time size (PROTOCORE_SMTP_*). Gated by PROTOCORE_ENABLE_SMTP.
Definition in file smtp.h.