Rewrite Rules verifiedimportantWritten by the Hub
Programmable handling of every job as it leaves the queue — nine condition types, eleven actions.
In detail
Rewrite rules run immediately after a job is read from the broker and before anything else happens, so they change the job rather than the message in flight. A rule has three parts: a trigger (address or pool, destination domain, tag, an active window with a start and an end, a precedence, and whether evaluation stops here), conditions (envelope or subject contains or equals; a JSON property equals, differs, contains, does not contain, or matches a pattern — addressed by JSON Pointer), and actions. The eleven actions: add, remove or set the sending address; set or unset a pool; add or remove a tag; delay the message by N seconds; hand it to a smarthost; apply a JSON Patch to the whole job; set or unset a property by pointer. This is the fourth way to choose a sending address, and for Hub the most convenient one: a tag on the job is enough, and the rule decides the address. No per-address queues, no address list in every message — one tag, one rule, and the mapping lives on the node where an operator can see it.