smtp
SMTP Protocol Helpers
Functions
| Function | Description |
|---|---|
_smtp_byte_at | Internal byte reader. |
_smtp_copy | Internal: copy bytes from src to dst+doff. |
_smtp_crlf | Internal: write CRLF at position. |
smtp_format_ehlo | Format EHLO command: “EHLO domain\r\n” |
smtp_format_mail_from | Format MAIL FROM command: “MAIL FROM: |
smtp_format_rcpt_to | Format RCPT TO command: “RCPT TO: |
smtp_format_data | Format DATA command: “DATA\r\n” |
smtp_parse_reply | Parse SMTP reply code from buffer. Returns integer code (e.g. 250). Expects f… |
smtp_reply_is_ok | Check if reply code is success (2xx). |
Details
_smtp_byte_at
fn _smtp_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_smtp_copy
fn _smtp_copy(dst: &i8, doff: i64, src: &i8, soff: i64, n: i64) -> i64Internal: copy bytes from src to dst+doff.
_smtp_crlf
fn _smtp_crlf(out: &i8, pos: i64) -> i64Internal: write CRLF at position.
smtp_format_ehlo
fn smtp_format_ehlo(domain: &i8, dlen: i64, out: &i8) -> i64Format EHLO command: “EHLO domain\r\n”
smtp_format_mail_from
fn smtp_format_mail_from(addr: &i8, alen: i64, out: &i8) -> i64Format MAIL FROM command: “MAIL FROM:
smtp_format_rcpt_to
fn smtp_format_rcpt_to(addr: &i8, alen: i64, out: &i8) -> i64Format RCPT TO command: “RCPT TO:
smtp_format_data
fn smtp_format_data(out: &i8) -> i64Format DATA command: “DATA\r\n”
smtp_parse_reply
fn smtp_parse_reply(buf: &i8, len: i64) -> i64Parse SMTP reply code from buffer. Returns integer code (e.g. 250). Expects first 3 bytes to be ASCII digits.
smtp_reply_is_ok
fn smtp_reply_is_ok(code: i64) -> i64Check if reply code is success (2xx).