Skip to main content

Module mail_file

Module mail_file 

Source
Expand description

Filing: a sender that does not wait for its mail to arrive (a board’s dispatcher, a script) writes the envelope into the receiver’s mailbox here and stops (docs/adr/0008-agent-mailbox.md, decision 17; D140). The write is local, needs no network and is idempotent by the message id its key fixes. The mailbox delivers it from there: the machine daemon’s watch loop (crate::mail_watch::MailCarrier) hands it to its session by the session’s own door, or, for an address on another machine, carries it there through Teams and files it with the same wake.

Structs§

Filed
What a filing did.
Filing
One message to file.

Functions§

file
File body from caller in the mailbox of to, on this machine’s mail root whatever machine to names (mail for another machine waits here until the watch loop has carried it there). A wake is requested only by the filing that wrote the message, so a repeat never delivers it twice.
message_id_for
The id of a message sender sends under key: a key that is itself a whole message id (m- and 24 lowercase hex digits) is that id, so a sender that chose it beforehand (a board blocking a card on the answer to the question it is about to send) knows what the answer will name; any other key is hashed with the sender’s address; no key is a fresh id.