code wiki / _hdl_build / nx_smtp_probe.nx

nx_smtp_probe.nx

buildroot/runtime/_hdl_build/nx_smtp_probe.nx

6984 B134 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind probetopic smtp
docsdependenciesstructsconstsfunctions

about

nx_smtp_probe.nx -- SOVEREIGN outbound-SMTP reachability probe (zero shell, zero curl). THE make-or-break fact for full self-hosted MX (EMAIL-D3 first act): can this network open TCP to a real Gmail MX on port 25 and receive the "220" SMTP banner? Many ISPs silently block outbound 25 while 443/587 work -- in that case no amount of MTA code will ever deliver to Gmail and the operator must get the port opened (or move the mail host). Battery (default): gmail-smtp-in.l.google.com:25 + aspmx.l.google.com:25 (two independent Google MXes = the real test) vs smtp.gmail.com:587 + :465 (submission CONTROLS -- normally never ISP-blocked; they discriminate "port-25 block" from "no outbound at all"). Composes the proven substrate: nx_dns_resolve_default (sovereign DNS) + BSD sockets with sys_set_socket_timeout(10s) so a blackholed port FAILS GRACEFULLY, never hangs. usage: nx_smtp_probe [host port] (no args = the default battery) verdict: exit 0 iff at least one :25 target returned an SMTP 220 banner (OPEN); exit 1 otherwise (BLOCKED-OR-UNREACHABLE). Appends knowledge/status/smtp_probe.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_dns_resolve_a_record.nx nx_smtp_probe.nx

imports: nx_syscalls.nxnx_connect.nxnx_dns_resolve_a_record.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sp_puts sys_write sp_probe sp_puts ↻ sp_putn sys_write ↻ sys_mmap sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real nx_dns_resolve_default nx_dns_resolve_with_failov nx_dns_resolve_a_record sys_mmap ↻ nx_dns_build_query nx_dns_put_u16_be nx_dns_encode_name sys_socket sys_set_socket_timeout sys_mmap ↻ sys_setsockopt sys_munmap sys_sendto sys_close sys_recvfrom nx_dns_parse_response_a nx_dns_get_u16_be nx_dns_skip_name sp_slen sp_ip sp_putn ↻ sp_puts ↻ sys_socket ↻ sys_set_socket_timeout ↻ sys_mmap ↻ sp_sockaddr nx_connect_bounded nx_fcntl sys_connect

structs

none

consts

none

functions

19func sp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 3: sp_ipsp_probemain calls 1: sys_write
20func sp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: sp_probe
21func sp_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
22func sp_putn(v: i64) -> i64
called by 3: sp_ipsp_probemain calls 2: sys_writesys_mmap
32func sp_ip(packed: i64) -> i64
called by 1: sp_probe calls 2: sp_putnsp_puts
39func sp_atoi(s: *u8) -> i64
called by 1: main
49func sp_sockaddr(out: *u8, packed: i64, port: i64) -> i64
called by 1: sp_probe
64func sp_probe(host: *u8, port: i64) -> i64
100func main(argc: i64, argv: *i64) -> i64