Files
inbuxa-server/crates/smtp
jcoffey-dev 00db2d8a7a
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 10m8s
Relay: inbuxa:RelayMessage, a relay's queues read over the link
The Relays page needs to show what waits at each relay, and to let an
administrator discard held mail or cancel an outbound message, without
ever talking to a relay itself (relay spec, "Registry objects").

inbuxa:RelayMessage has get, query and set (destroy only) under
urn:inbuxa:jmap, with sysRelayQueueGet and sysRelayQueueUpdate. The asking
node reads the relay's Inbound and Outbound over its own link, through a
new call on the link's sender, and shows each message's envelope, size,
times and state: the session and door checks for inbound mail, the
per-recipient status and retry state for outbound, and the message in
this server's queue it was handed from. Never the blob. Query filters by
relayId and direction, newest first. Nothing is stored: an id is the
relay's id (top 16 bits) and a hash of the relay's own message id, so
every node names a message the same way, and a lookup checks it against
the relay's queues. A relay this node can't reach is left out of a query
of all relays and is an error when asked for by itself.

Destroying held mail destroys it at the relay, unless a node is taking
it just then. Cancelling an outbound message fails its recipients here
first, with no DSN, the way a delivery cancelled in the queue does, so
the queue never hands it over again; then the relay drops it. If the
relay is sending it at that moment, it drops it at its next status: the
follower now also destroys the relay's copy when none of its recipients
waits on the relay any more. Every destroy is audited, with its reason.

Test: unit test for the ids. The relay system test reads the relay's
outbound queue, finds the deferred message with the remote server's
reply and its queue id and no blob, cancels it, and sees it gone from
both queues with no DSN; a second destroy is notFound and an update is
forbidden.
2026-10-30 13:25:12 -07:00
..