code wiki / (root) / nx_email_webmail.nx

nx_email_webmail.nx

buildroot/runtime/nx_email_webmail.nx

9375 B209 linesdepth 4pulls 6 transitivereach 4 importersview sourcekind librarytopic email
docsdependenciesstructsconstsfunctions

about

nx_email_webmail.nx -- EMAIL LIVE LAYER: web UI to manage a mailbox. module: nishi-core.email.webmail depends: nishi-core.email.mailbox, nishi-core.email.mime capability: CORE_EMAIL The MANAGE half of a working mailbox: an HTTP/1.1 handler that renders the R3 store as a webmail inbox -- list messages (Subject/From parsed via R2 nx_mime_header_find), view one, and DELETE one (soft-delete via R3 tombstone). Pure HTML over the store; no third-party web framework. nx_webmail_serve_conn drops into an accept loop (the gate forks a real HTTP client at it; a daemon would loop accept()). Routes: GET / -> inbox list GET /msg?n=K -> message K full text GET /del?n=K -> soft-delete K, redraw inbox license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_9110 lineage_id: nishi_email_webmail nx_safety_envelope: intended_use: "Render/manage a mailbox over HTTP/1.1. Compose R3 store + R2 header parse." sil_target: SIL1 (display; delete is soft/reversible) evidence: [list_shows_subjects, delete_tombstones, html_escaped, redraw_reflects_delete] hazard_register: [bug-tape-html-injection, bug-tape-stored-xss] residual_risk: "AuthN on the UI + CSRF token on /del + pagination are follow-ons (bind 127.0.0.1 only for now)." verdict: NOT_YET_EVALUATED

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_email_mailbox.nx nx_email_mime.nx nx_email_webmail.nx nx_email_portal_daemon.nx nx_email_webmail_daemon.nx nx_email_webmail_gate.nx

imports: nx_syscalls.nxnx_email_mailbox.nxnx_email_mime.nx

imported by: nx_email_portal_daemon.nxnx_email_webmail_daemon.nxnx_email_webmail_gate.nx

structs

none

consts

36const WM_MAGIC_2048: i64 = 2048
37const WM_MAGIC_8192: i64 = 8192
38const WM_MAGIC_8191: i64 = 8191
39const WM_MAGIC_1024: i64 = 1024
40const WM_MAGIC_262144: i64 = 262144
41const WM_MAGIC_270000: i64 = 270000
69const WM_STYLE: *u8 = "<style>body{font-family:system-ui,sans-serif;margin:2rem;background:#0b1020;color:#e6e9f0}a{color:#7ab8ff;text-decoration:none}h1{font-size:1.25rem}ul{list-style:none;padding:0}li{padding:.6rem .8rem;border:1px solid #243049;border-radius:8px;margin:.45rem 0;background:#121a2e}.f{color:#9fb3d9;font-size:.85rem;margin-top:.2rem}.s{font-weight:600}pre{white-space:pre-wrap;background:#121a2e;border:1px solid #243049;border-radius:8px;padding:1rem}</style>"

functions

43func wm_cat(out: *u8, oi: i64, s: *u8) -> i64
48func wm_int(out: *u8, oi: i64, v: i64) -> i64
56func wm_esc(out: *u8, oi: i64, src: *u8, n: i64) -> i64
72func nx_webmail_render_inbox(prefix: *u8, mailbox: *u8, out: *u8, cap: i64) -> i64
113func nx_webmail_render_message(prefix: *u8, mailbox: *u8, idx: i64, out: *u8, cap: i64) -> i64
132func nx_webmail_http_response(out: *u8, cap: i64, body: *u8, blen: i64) -> i64
called by 1: nx_webmail_serve_conn calls 2: wm_catwm_int
143func wm_req_path(req: *u8, n: i64, out: *u8, cap: i64) -> i64
155func wm_n_param(path: *u8, plen: i64) -> i64
167func wm_starts(path: *u8, plen: i64, pfx: *u8, pl: i64) -> i64
176func nx_webmail_serve_conn(fd: i64, prefix: *u8, mailbox: *u8, segctr: *i64) -> i64