PowerMTA Pattern Lists and Routing
Use sender and recipient patterns for deterministic routing while avoiding unsafe catch-all rules.
Why patterns matter
Patterns convert message attributes into routing decisions. They should be explicit, ordered and easy to audit.
Sender-domain example
<pattern-list sender-routing>
mail-from /@customer-a\.example$/ virtual-mta=customer-a-vmta
mail-from /@customer-b\.example$/ virtual-mta=customer-b-vmta
</pattern-list>Ordering
Place specific rules before broad rules. A broad expression can shadow everything below it. Anchor regular expressions so a substring cannot accidentally match an unrelated domain.
Safe deployment
- Test patterns against expected and unexpected addresses
- Define a deliberate default path
- Reject unauthorized senders at submission
- Log routing decisions during rollout
- Keep customer ownership data synchronized
Troubleshooting
When a message uses the wrong VMTA, inspect the actual envelope sender, selected pattern list, rule order and whether the referenced VMTA exists. Header From is not necessarily the envelope sender.