QMail components
QMail reference
Server and Hosting
Source snapshot: 9b4f8a3 (2026-09-23); retained QMail clone, including M7.
Working = implemented in this snapshot, not a new runtime/test certification.
Partial = an identified implementation/exposure gap; obsolete = retained compatibility only.
Entry points and static functions are selected navigation anchors; full lexical index: function-index.txt.
Used by / Tests list selected source references (including callback registration), not a proven dynamic call graph.
Tests were inspected, not executed; use tools/test.ps1 with isolated scratch data.
Old paths come from docs/path-map.txt; absent mappings denote additions after the move.
Content Server storage and sessions
Purpose Maintain master secrets, sessions, stripes/objects and locker payments for Content Servers.
Files src/server/cs_vault.c
src/server/cs_vault_seal.c
src/server/cs_session.c
src/server/cs_crypto.c
src/server/cs_crc32.c
src/server/cs_identity.c
src/server/cs_identity_sdk.c
src/server/cs_stripe.c
src/server/cs_object.c
src/server/cs_object_cmd.c
src/server/cs_payment.c
src/server/cs_raida_map.c
Old paths vendor/content-server/src/cs_vault.c -> src/server/cs_vault.c
vendor/content-server/src/cs_vault_seal.c -> src/server/cs_vault_seal.c
vendor/content-server/src/cs_session.c -> src/server/cs_session.c
vendor/content-server/src/cs_crypto.c -> src/server/cs_crypto.c
vendor/content-server/src/cs_crc32.c -> src/server/cs_crc32.c
vendor/content-server/src/cs_identity.c -> src/server/cs_identity.c
vendor/content-server/src/cs_identity_sdk.c -> src/server/cs_identity_sdk.c
vendor/content-server/src/cs_stripe.c -> src/server/cs_stripe.c
vendor/content-server/src/cs_object.c -> src/server/cs_object.c
vendor/content-server/src/cs_object_cmd.c -> src/server/cs_object_cmd.c
vendor/content-server/src/cs_payment.c -> src/server/cs_payment.c
vendor/content-server/src/cs_raida_map.c -> src/server/cs_raida_map.c
Public header include/cs_crypto.h
include/cs_identity.h
include/cs_object.h
include/cs_payment.h
include/cs_raida_map.h
include/cs_session.h
include/cs_stripe.h
include/cs_vault.h
include/cs_vault_seal.h
Entry points src/server/cs_vault.c:417 :: cs_vault_init()
src/server/cs_vault.c:86 :: cs_vault_set_wipe_observer()
src/server/cs_vault_seal.c:95 :: cs_vault_seal_force_encrypt_failure()
src/server/cs_session.c:115 :: cs_session_table_lock()
src/server/cs_crypto.c:16 :: cs_random_bytes()
src/server/cs_identity.c:51 :: cs_identity_validate_fanout()
src/server/cs_identity_sdk.c:7 :: cs_identity_sdk_batch_redeem()
src/server/cs_stripe.c:9 :: cs_stripe_store_init()
src/server/cs_object.c:247 :: cs_object_identity_equal()
src/server/cs_object_cmd.c:122 :: cs_object_result_free()
src/server/cs_payment.c:216 :: cs_locker_build_peek()
Important static functions src/server/cs_vault.c:317 :: open_owner_only_for_write()
src/server/cs_vault.c:452 :: load_fail()
src/server/cs_vault_seal.c:62 :: build_aad()
src/server/cs_object.c:378 :: record_parse()
src/server/cs_object.c:517 :: recover_objects()
src/server/cs_object_cmd.c:88 :: common_valid()
src/server/cs_object_cmd.c:569 :: commit_precondition_status()
src/server/cs_payment.c:176 :: build_group8()
Owns Server vault, session table, object store and payment processing.
Used by src/server/cs_cmd.c
src/server/cs_daemon.c
src/server/cs_daemon_status.c
src/server/cs_type9.c
src/server/cs_type9_listener.c
src/server/hosting_adapter.c
src/server/hosting_services.c
Side effects Listener/network I/O, server storage writes and process lifecycle changes; hosting actions are explicitly opted into.
Tests tests/integ/hosting_adapter_test.c
tests/unit/server/test_cs_daemon.c
tests/unit/server/test_cs_daemon_e2e.c
tests/unit/server/test_cs_listener_socket.c
tests/unit/server/test_cs_object_dispatch.c
tests/unit/server/test_cs_object_durability.c
tests/unit/server/test_cs_payment.c
tests/unit/server/test_cs_session_lock.c
Platforms Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status working
Content Server Type 9 listener
Purpose Accept and dispatch Content Server Type 9 frames.
Files src/server/cs_type9.c
src/server/cs_type9_listener.c
src/server/cs_cmd.c
Old paths vendor/content-server/src/cs_type9.c -> src/server/cs_type9.c
vendor/content-server/src/cs_type9_listener.c -> src/server/cs_type9_listener.c
vendor/content-server/src/cs_cmd.c -> src/server/cs_cmd.c
Public header include/cs_cmd.h
include/cs_type9.h
include/cs_type9_listener.h
Entry points src/server/cs_type9.c:185 :: cs_type9_ctx_init()
src/server/cs_type9_listener.c:338 :: cs_type9_listener_init()
src/server/cs_cmd.c:49 :: cs_cmd_build_request()
Important static functions src/server/cs_type9.c:358 :: challenge_valid()
src/server/cs_type9_listener.c:72 :: wait_readable()
src/server/cs_cmd.c:105 :: handle_payload()
src/server/cs_type9.c:25 :: secure_zero()
src/server/cs_type9_listener.c:28 :: get_u32_be()
src/server/cs_cmd.c:10 :: put_u16_be()
Owns Content Server Type 9 envelope and dispatch.
Used by src/server/cs_daemon.c
Side effects Binds sockets, accepts sessions and dispatches requests to server storage/payment handlers.
Tests tests/unit/server/test_cs_hv2_en9.c
tests/unit/server/test_cs_listener_socket.c
tests/unit/server/test_cs_object_dispatch.c
tests/unit/server/test_cs_session_lock.c
tests/unit/server/test_cs_session_table.c
tests/unit/server/test_cs_stripe.c
tests/unit/server/test_cs_type9_e2e.c
Platforms Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status working; RAIDAX Type 9 is prohibited and not part of this tree. Lab Type 0 fan-out is tests/unit/server, not the shipping server library.
Daemon config, status and executable
Purpose Parse operator configuration, manage the daemon and expose status/control data.
Files src/server/cs_daemon_config.c
src/server/cs_daemon_status.c
src/server/cs_daemon.c
src/server/qmail_server_main.c
Old paths vendor/content-server/src/cs_daemon_config.c -> src/server/cs_daemon_config.c
vendor/content-server/src/cs_daemon_status.c -> src/server/cs_daemon_status.c
vendor/content-server/src/cs_daemon.c -> src/server/cs_daemon.c
vendor/content-server/tools/qmail_server_main.c -> src/server/qmail_server_main.c
Public header include/cs_daemon.h
include/cs_daemon_config.h
include/cs_daemon_status.h
Entry points src/server/cs_daemon_config.c:40 :: cs_daemon_config_defaults()
src/server/qmail_server_main.c:288 :: main()
src/server/cs_daemon_status.c:30 :: cs_daemon_state_name()
src/server/cs_daemon.c:63 :: cs_daemon_wipe_vault()
Important static functions src/server/cs_daemon_config.c:68 :: parse_long_range()
src/server/cs_daemon_config.c:93 :: parse_u64_range()
src/server/cs_daemon_status.c:352 :: write_token_file()
src/server/cs_daemon.c:256 :: daemon_collect_once()
src/server/cs_daemon.c:292 :: daemon_collector_start()
src/server/qmail_server_main.c:122 :: listener_thread()
src/server/qmail_server_main.c:128 :: listener_thread()
src/server/cs_daemon_status.c:54 :: copy_sanitised()
Owns Server config dialect, defaults and status contract.
Used by src/server/hosting_adapter.c
src/server/hosting_services.c
Side effects Reads configuration, writes status and runs the server lifecycle.
Tests tests/integ/hosting_adapter_test.c
tests/unit/server/test_cs_daemon.c
tests/unit/server/test_cs_daemon_e2e.c
tests/unit/server/test_cs_payment.c
Platforms Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status working
Hosting adapter and provisioning
Purpose Apply opt-in hosting, Mega/Giga/Epic eligibility, key provisioning, DRD publication and connectivity diagnostics.
Files src/server/hosting_adapter.c
src/server/hosting_services.c
src/server/hosting_connectivity.c
src/server/hosting_background.c
Old paths src/gui/hosting_adapter.c -> src/server/hosting_adapter.c
src/gui/hosting_services.c -> src/server/hosting_services.c
src/gui/hosting_connectivity.c -> src/server/hosting_connectivity.c
src/gui/hosting_background.c -> src/server/hosting_background.c
Public header include/qmail/hosting_adapter.h
include/qmail/hosting_services.h
Entry points src/server/hosting_adapter.c:274 :: qmail_hosting_request()
src/server/hosting_services.c:30 :: qmail_hosting_provision()
src/server/hosting_connectivity.c:21 :: qmail_hosting_local_ipv4()
src/server/hosting_background.c:41 :: qmail_hosting_background_start()
Important static functions src/server/hosting_adapter.c:41 :: read_record()
src/server/hosting_adapter.c:84 :: save_record()
src/server/hosting_services.c:16 :: load_keys()
src/server/hosting_connectivity.c:148 :: service_url_valid()
src/server/hosting_services.c:29 :: key_for()
src/server/hosting_connectivity.c:47 :: clock_ms()
src/server/hosting_background.c:10 :: monitor()
Owns Hosting eligibility and configuration workflow; uptime is derived by hosting_uptime.c.
Used by src/app/client_inproc.c
src/app/main.c
src/gui/server_adapter.c
src/server/hosting_supervisor.c
Side effects Listener/network I/O, server storage writes and process lifecycle changes; hosting actions are explicitly opted into.
Tests tests/integ/hosting_adapter_test.c
tests/integ/hosting_connectivity_test.c
tests/integ/hosting_publication_test.c
Platforms Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status working; Hosting is off by default; DRD separately opt-in. A local bind is not external reachability. Fleet Mega DRD admission remains pending per owner instructions.
Supervisor and process control
Purpose Run hosting outside the GUI, identify child processes by PID/birth/executable and manage autostart.
Files src/server/hosting_supervisor.c
src/server/hosting_process.c
src/server/hosting_startup.c
Old paths src/gui/hosting_supervisor.c -> src/server/hosting_supervisor.c
src/gui/hosting_process.c -> src/server/hosting_process.c
src/gui/hosting_startup.c -> src/server/hosting_startup.c
Public header include/qmail/hosting_process.h
Entry points src/server/hosting_supervisor.c:16 :: main()
src/server/hosting_process.c:85 :: main()
src/server/hosting_process.c:50 :: qmail_host_process_start()
src/server/hosting_process.c:133 :: qmail_host_process_start()
src/server/hosting_process.c:72 :: qmail_host_process_stop()
src/server/hosting_process.c:153 :: qmail_host_process_stop()
src/server/hosting_startup.c:26 :: qmail_host_autostart()
src/server/hosting_process.c:23 :: qmail_host_process_alive()
Important static functions src/server/hosting_process.c:11 :: same_image()
src/server/hosting_process.c:15 :: verified()
src/server/hosting_startup.c:15 :: autostart_run_key()
Owns Hosting process lifecycle and supervisor handoff.
Used by src/server/hosting_adapter.c
src/server/hosting_background.c
Side effects Starts/stops/inspects child processes and modifies operator-enabled autostart registration.
Tests tests/integ/hosting_adapter_test.c
Platforms Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status partial; Windows control-helper target only; non-Windows process branches exist but full Linux/macOS parity unverified.
Connectivity PHP handoff
Purpose Offer the HTTPS callback diagnostics endpoint and fleet query implementation.
Files tools/connectivity/php/qmail-server-test.php
tools/connectivity/fleet/qmail-server-test.php
Old paths No changed-path mapping for these files.
Public header None identified; executable/tool/internal component.
Entry points tools/connectivity/php/qmail-server-test.php :: qmail_test_request(); tools/connectivity/fleet/qmail-server-test.php :: qmail_test_request() (HTTP entry)
Important static functions None identified by lexical inspection; C++ methods and script helpers are outside the C static index.
Owns Connectivity service request handling.
Used by No external C symbol reference identified; see target/script membership and integration notes.
Side effects Contacts the requesting public endpoint and writes throttling state; never run against arbitrary targets during catalog generation.
Tests No direct symbol-reference test identified; indirect integration coverage is uncertain.
Platforms Server-side PHP; PHP 7.2-compatible fleet artifact by source contract.
Status working; R11 deployment is reported in AGENTS.md; fleet handoff is prepared, not deployed here. PHP compatibility/runtime was not exercised for these existing service sources.