nx_email_webmail.nx
buildroot/runtime/nx_email_webmail.nx
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
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
| 36 | const WM_MAGIC_2048: i64 = 2048 |
| 37 | const WM_MAGIC_8192: i64 = 8192 |
| 38 | const WM_MAGIC_8191: i64 = 8191 |
| 39 | const WM_MAGIC_1024: i64 = 1024 |
| 40 | const WM_MAGIC_262144: i64 = 262144 |
| 41 | const WM_MAGIC_270000: i64 = 270000 |
| 69 | const 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
| 43 | func wm_cat(out: *u8, oi: i64, s: *u8) -> i64 |
| 48 | func wm_int(out: *u8, oi: i64, v: i64) -> i64 called by 3: nx_webmail_render_inboxnx_webmail_render_messagenx_webmail_http_response calls 1: sys_mmap |
| 56 | func wm_esc(out: *u8, oi: i64, src: *u8, n: i64) -> i64 called by 7: epd_inbox_fragepd_inbox_pageepd_read_pageepd_sent_pageepd_handlenx_webmail_render_inbox+1 calls 1: wm_cat |
| 72 | func nx_webmail_render_inbox(prefix: *u8, mailbox: *u8, out: *u8, cap: i64) -> i64 called by 1: nx_webmail_serve_conn calls 8: wm_catnx_mbox_countsys_mmapnx_mbox_get_nnx_mime_split_bodynx_mime_header_find+2 |
| 113 | func nx_webmail_render_message(prefix: *u8, mailbox: *u8, idx: i64, out: *u8, cap: i64) -> i64 |
| 132 | func nx_webmail_http_response(out: *u8, cap: i64, body: *u8, blen: i64) -> i64 |
| 143 | func wm_req_path(req: *u8, n: i64, out: *u8, cap: i64) -> i64 called by 1: nx_webmail_serve_conn |
| 155 | func wm_n_param(path: *u8, plen: i64) -> i64 called by 1: nx_webmail_serve_conn |
| 167 | func wm_starts(path: *u8, plen: i64, pfx: *u8, pl: i64) -> i64 called by 1: nx_webmail_serve_conn |
| 176 | func nx_webmail_serve_conn(fd: i64, prefix: *u8, mailbox: *u8, segctr: *i64) -> i64 |