Expand description
Local control channel: POST /control/{drain,reload,handoff}.
Lets a successor (a newer mail4agent, or a host such as a hatchery node)
take this daemon over gracefully instead of killing it. Authentication is
owner-only: a random token in a file only the owning user can read
(control.token next to the database, or MAIL4AGENT_CONTROL_TOKEN_FILE).
The file is created with mode 0600 on Unix; on Windows it lives in the
per-user data directory, whose ACL admits only that user (and SYSTEM /
administrators). The path is published in /health (not the token).
drain: stop accepting new mail (/mail/sendand the MCP tools answer 503); reads, acks and health keep working.{"draining": false}undoes it.reload: re-read the config file and report what changed; nothing is hot-swapped (the bind and db path need a handoff).handoff: drain, answer 202, then stop serving afterrelease_after_msso the successor can bind the same address. The process exits by itself.
Structs§
Constants§
Functions§
- default_
token_ file - Default token file:
control.tokenbeside the database. - drain_
gate - Refuse new mail while draining.
- handle