mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-19 19:08:17 +00:00
7f4a929ca2
This commit implements a kumomta-specific message transfer protocol that is intended to be used to migrate messages from one kumomta node to another. The transfer is carried out using an HTTP POST request to the destination node's http listener. The request includes the full message metadata and body, in a compressed form. An xfer request can be made via `kcli xfer` (and thus also via an HTTP API endpoint). It works similarly to a rebind operation; you specify the criteria to be used to match scheduled queues, along with the target node for the xfer, and kumomta will find matching queues, drain out the messages, make an adjustment to the metadata to capture current scheduling information, and then place the messages into an xfer queue. The xfer queue has hard-coded scheduling queue configuration of its own, with the base retry interval set to 10 seconds, which should be suitably aggressive for the intended use case. You may apply shaping to affect the number of concurrent requests in a similar way to how TSA shaping is configured. On the receiving side, the incoming xfer sanity check to prohibit trying to xfer to itself. The spool id of the Message is not suitable to be reused verbatim on another node (spool ids include the local mac address and creation timestamp information, as well as a random component), so the receiving side will derive an id that should be suitable for use on that node. The originating node id and spool id will be preserved in metadata to aid in tracing. It is possible for an xfer request to target an existing xfer queue, so that you can correct/update the target in various circumstances. In that situation the messages will be "simply" moved from the source queue to the destination queue. It is possible to cancel an xfer request via `kcli xfer-cancel` (and thus also via an HTTP API endpoint). You specify the target queue, which must be an xfer queue, and it will have its messages drained and the metadata changes that were applied when the xfer was initiated will be reversed, allowing the messages to then be reinserted into their originating queue. refs: https://github.com/KumoCorp/kumomta/issues/311