<pattern-list>
The only rule in the list with a parameter: first the header name, then the pattern, then the result. Any header can be matched — a service one like x-eval or an ordinary one like subject and from.
The entire header content is matched as a whole — along with the spaces, tabs and line breaks left in it. The manual puts special emphasis on this: if you anchor the pattern with ^ and $, leave room for spaces — the \s metacharacter is there for that.
The From header is not the return address. A rule on from matches what the recipient sees, and the sender is free to write anything there. For reliable routing, the envelope is used, not the header.
What to match and what it risks:
| Header | Suitable | Caveat |
|---|---|---|
| the platform’s own service header | yes | the most stable option |
| subject | sometimes | changes from campaign to campaign |
| from | with caution | it is not the envelope: the sender writes whatever they want there |
A mandatory habit is to allow spaces around the value: /^\s*pattern\s*$/. The header content arrives as is, including spaces after the colon and line breaks inside long values.
# the platform's identifying header as a routing key <pattern-list partner-selector> header x-platform /^\s*partner-crm\s*$/ virtual-mta=partner-crm mail-from /@partner\.example\.com$/ virtual-mta=partner-crm </pattern-list>
what people get wrong and how it ends2 mistakes▶
§ 3.3.14.1
§ 3.3.14.2
2 relations
pmtaacctfind --output csv[vmta,orig,jobId] /var/log/pmta/acct-*.csv | head -30
3 articles
◇Headers the sender uses to control deliverySix control headers let the submitting side choose a stream, tag a message with a job, set signing options and the key, the envelope identifier and the schedule; each is allowed separately and per source.◇Selecting a sending address by message contentRegular expressions are matched against a header, the return address or the recipient and select a sending address or assign a priority; lists can call each other.◇How a message gets into the engineSix described submission methods: extended SMTP, four language bindings and a directory the node watches on disk.