Mail receive

Mail receive
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.

Receive and attachment reconstruction

Purpose
Consume Tell endpoints, download revised object ranges or legacy pages, reconstruct payloads and persist receipts.
Files
src/mail/qmail_receive.c src/mail/qmail_receive_object_transfer.c src/mail/qmail_receive_object_reconstruct.c src/mail/qmail_download.c src/mail/qmail_peek.c src/mail/qmail_ping.c src/mail/qmail_receipt.c
Old paths
vendor/core/src/qmail/qmail_receive.c -> src/mail/qmail_receive.c vendor/core/src/qmail/qmail_receive_object_transfer.c -> src/mail/qmail_receive_object_transfer.c vendor/core/src/qmail/qmail_receive_object_reconstruct.c -> src/mail/qmail_receive_object_reconstruct.c vendor/core/src/qmail/qmail_download.c -> src/mail/qmail_download.c vendor/core/src/qmail/qmail_peek.c -> src/mail/qmail_peek.c vendor/core/src/qmail/qmail_ping.c -> src/mail/qmail_ping.c vendor/core/src/qmail/qmail_receipt.c -> src/mail/qmail_receipt.c
Public header
include/qmail/qmail_commands.h include/qmail/qmail_receipt.h include/qmail/qmail_receive.h include/qmail/qmail_receive_object_transfer.h
Entry points
src/mail/qmail_receive.c:1981 :: qmail_receive_email() src/mail/qmail_receive_object_transfer.c:109 :: qmail_receive_object_download() src/mail/qmail_receive_object_reconstruct.c:79 :: qmail_receive_object_reconstruct() src/mail/qmail_download.c:110 :: qmail_cmd_download() src/mail/qmail_ping.c:265 :: qmail_cmd_ping() src/mail/qmail_receipt.c:56 :: qmail_rcpt_status_to_string()
Important static functions
src/mail/qmail_receive.c:299 :: download_v1_entry_to_memory() src/mail/qmail_receive.c:443 :: qmail_receive_invalid_filename_char() src/mail/qmail_receive_object_transfer.c:96 :: recoverable() src/mail/qmail_receive_object_reconstruct.c:73 :: read_exact() src/mail/qmail_download.c:31 :: parse_download_response() src/mail/qmail_download.c:66 :: download_build_body() src/mail/qmail_ping.c:50 :: ping_peek_build_body() src/mail/qmail_ping.c:91 :: parse_ping_response()
Owns
Receive orchestration and attachment materialization; supports both readable manifest layouts.
Used by
src/app/desktop_api.c src/mail/qmail_beacon.c src/mail/qmail_tell_retry.c src/mail/qmail_upload_orchestrator.c src/mail/service/qmail_service.c src/mail/service/qmail_sync_notification.inc
Side effects
Reads wallet identity, polls/downloads over the network and writes received messages, attachments and receipts.
Tests
tests/unit/mail/qmail_ping_timeout_test.c tests/unit/mail/qmail_receipt_lifecycle_test.c tests/unit/mail/qmail_receipt_transfer_ids_test.c tests/unit/mail/qmail_receive_object_reconstruct_test.c tests/unit/mail/qmail_receive_resume_test.c tests/unit/mail/qmail_service_durability_test.c tests/unit/mail/qmail_tell_retry_test.c
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
working

Beacon polling

Purpose
Poll beacon RAIDAs in background workers and deliver new-mail notifications.
Files
src/mail/qmail_beacon.c
Old paths
vendor/core/src/qmail/qmail_beacon.c -> src/mail/qmail_beacon.c
Public header
include/qmail/qmail_beacon.h
Entry points
src/mail/qmail_beacon.c:835 :: qmail_beacon_start() src/mail/qmail_beacon.c:894 :: qmail_beacon_stop() src/mail/qmail_beacon.c:470 :: qmail_beacon_redrive_tell()
Important static functions
src/mail/qmail_beacon.c:205 :: beacon_configure_peers() src/mail/qmail_beacon.c:229 :: beacon_build_context()
Owns
Beacon worker start/stop and polling state.
Used by
src/app/desktop_api.c src/mail/service/qmail_service.c
Side effects
Reads wallet identity, polls/downloads over the network and writes received messages, attachments and receipts.
Tests
No direct symbol-reference test identified; indirect integration coverage is uncertain.
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
working

Local identity

Purpose
Resolve mailbox identity from the local Mail wallet.
Files
src/mail/qmail_users.c
Old paths
vendor/core/src/qmail/qmail_users.c -> src/mail/qmail_users.c
Public header
include/qmail/qmail_users.h
Entry points
src/mail/qmail_users.c:57 :: qmail_identity_get()
Important static functions
src/mail/qmail_users.c:40 :: identity_lock_init() src/mail/qmail_users.c:48 :: identity_lock()
Owns
Local mailbox coin identity lookup.
Used by
src/app/desktop_api.c src/app/desktop_api_more.c src/gui/server_adapter.c src/mail/qmail_beacon.c src/mail/qmail_parent_send.c src/mail/qmail_payment_send.c src/mail/qmail_receipt.c src/mail/qmail_receive.c
Side effects
Reads the Mail wallet and updates cached identity state.
Tests
tests/integ/hosting_publication_test.c tests/unit/mail/qmail_parent_send_test.c tests/unit/mail/qmail_receipt_lifecycle_test.c tests/unit/mail/qmail_receipt_transfer_ids_test.c tests/unit/mail/qmail_tell_retry_test.c
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
working