code wiki / (root) / nx_email_mta_io.nx

nx_email_mta_io.nx

buildroot/runtime/nx_email_mta_io.nx

7028 B165 linesdepth 4pulls 6 transitivereach 2 importersview sourcekind librarytopic email
docsdependenciesstructsconstsfunctions

about

nx_email_mta_io.nx -- EMAIL LIVE LAYER: SMTP server over a real socket. module: nishi-core.email.mta_io depends: nishi-core.email.mta, nishi-core.email.retrieve, nishi-core.email.mailbox capability: CORE_EMAIL Crosses the pure R7 server LOGIC into a running service: read SMTP command lines off a connected fd, drive the nx_email_mta FSM, collect the DATA phase, de-dot-stuff it (R4 nx_pop3_dedot), and DELIVER each accepted recipient's copy into the R3 mailbox store (nx_email_mailbox over nx_seg_store). One function serves one connection so it drops straight into an accept loop (the loopback gate forks a client at it; a real daemon would loop accept()). This is the receive half of a working mailbox: mail addressed to a local recipient (e.g. self@jasonewest.com) lands in the store, where the web UI (next rung) reads it. license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_5321 lineage_id: nishi_email_mta_io nx_safety_envelope: intended_use: "Serve one inbound SMTP connection: FSM + relay policy + DATA collect + dedot + store delivery." sil_target: SIL2 (open relay / mail loss) evidence: [live_loopback_deliver, relay_refused_on_wire, byte_exact_after_dedot] hazard_register: [bug-tape-open-relay, bug-tape-unbounded-data] residual_risk: "STARTTLS-on-25 + SIZE limit + concurrent accept loop are follow-ons; this serves one conn." verdict: NOT_YET_EVALUATED

dependencies 4 imports · 2 importers

nx_syscalls.nx nx_email_mta.nx nx_email_retrieve.nx nx_email_mailbox.nx nx_email_mta_io.nx nx_email_live_gate.nx nx_email_mta_daemon.nx

imports: nx_syscalls.nxnx_email_mta.nxnx_email_retrieve.nxnx_email_mailbox.nx

imported by: nx_email_live_gate.nxnx_email_mta_daemon.nx

structs

none

consts

38const MTAIO_MAGIC_4096: i64 = 4096
40const MTAIO_MAX_RCPT: i64 = 8
41const MTAIO_DATA_CAP: i64 = 262144

functions

44func mtaio_send(fd: i64, s: *u8) -> i64
57func mtaio_send_code(fd: i64, code: i64) -> i64
called by 1: nx_mta_serve_conn calls 1: mtaio_send
69func mtaio_recv_line(fd: i64, buf: *u8, cap: i64) -> i64
called by 1: nx_mta_serve_conn calls 1: sys_read
85func nx_mta_serve_conn(fd: i64, prefix: *u8, domain: *u8, dlen: i64, segid_base: i64) -> i64