Globalset by the Hub
The line declares a name and a list of domains bound to it, separated by commas. After that this name with a dollar sign is substituted where a list is needed: in a recipient block <domain $name>, in domain-based acceptance relay-domain, in a signing key declaration domain-key.
The name may contain only letters, digits and underscores — the manual states this directly.
The point is practical: a major receiver serves dozens of domains, and keeping them as a list in every rule is unreadable. One macro — one place to edit.
What needs checking is not the macro line but all substitution places.
The other half is minor: the name is checked for letters, digits and underscores. A hyphen in the name — a common habit from domain names — does not work here.
The layout there is exactly the one macros were made for: the macro line lists the receiver’s domains, followed by a <domain $name> block with its policy — limits, retries, bounce deadline.
What to set. The value is a name and a list; the rules follow from the purpose:
| Property | Why |
|---|---|
| name by receiver, not by attribute | the list is edited together with the receiver, not with the idea |
| only letters, digits, underscores | an engine requirement |
| one macro — one receiver | otherwise an edit affects other rules |
An “all major ones” macro looks convenient and turns out to be dangerous: receivers have different policies, and combining them in a list means losing the ability to tell them apart.
# this is how the Hub writes policies: a macro per receiver, then its block domain-macro mailru mail.ru,bk.ru,inbox.ru,list.ru<domain $mailru> max-errors-per-connection 10 retry-after 30m </domain>
what people get wrong and how it ends2 mistakes▶
our experience
§ 3.3.1.55.4
2 relations
grep -n '^domain-macro' /etc/pmta/config grep -n '\$[a-zA-Z_][a-zA-Z0-9_]*' /etc/pmta/config | head -20
3 articles
◇Four value types the whole config is written inBoolean, domain pattern, regular expression and time interval — defined once in § 3.2 and then used by all directives.◇How the policy for a receiver is assembledSettings are assembled from the most general pattern to the most precise; the order of blocks in the file means nothing.◇Backoff mode — the queue's second personalityA queue that a receiver has started refusing switches to a parallel set of limits, retries and routes — ten directives that act only in this mode.