Globalcritical
Four words where smtp-source-host has two: a local address or range; the proxy with its port; the address the proxy will present to the receiver (optionally with a port); the greeting name.
It can be repeated — the lines add up to a set with round-robin rotation, as with the regular form. Only local addresses of the same IP version as the proxy get into the set: a version mismatch silently yields an empty or incomplete set.
Inside a sending address it overrides the general setting and rules out two others: neither smtp-source-host nor use-proxy may be used in the same sending address.
Why the vendor recommends this one rather than use-proxy. Two reasons, and the second matters more: the lines rotate round-robin; and all the machinery for disabling misbehaving addresses works by the proxy client address — the one the receiver saw — rather than by the local one. That is, disabled-source-ip-notify, reenable-source-ip-after and disabling an address by a rule count what actually makes sense.
The order of the words and what to put in them:
| Word | What it is | What to watch |
|---|---|---|
| first | a local address or CIDR range | only addresses of the same IP version as the proxy |
| second | the proxy and port | a name or an address; the port is required |
| third | the client address the receiver will see | a port is allowed; the node does not check it |
| fourth | the greeting name | matches the reverse record of the client address, not the local one |
The reverse record point is not a footnote but the essence. The receiver sees the proxy client address; the greeting name must match its reverse record. Run dig -x against the proxy address, not the local one.
# local address → proxy → the address the receiver will see → name <virtual-mta shop-via-proxy> smtp-proxy-source-host 10.0.0.5 proxy.example.net:5000 198.51.100.7 shop.example.com proxy-protocol 2 </virtual-mta>
what people get wrong and how it ends3 mistakes▶
§ 3.3.1.23
§ 3.3.1.23
§ 11.3
4 relations
proxy-protocolGlobalSets the version of the PROXY protocol the node uses to talk to the proxy. § 3.3.1.48proxy-include-tlvGlobalAdds the queue domain to the PROXY header; requires the second version of the protocol. § 3.3.1.49
host-nameGlobalTakes part in the same resolution, including the case of selection by connection address. § 3.3.1.35check-spf-outbound<domain>The second way to set a sending address — when working through a proxy. § 3.3.10.2proxy-retry-after<domain>The line that makes all of this work: without sending through a proxy there are no proxy failures. § 3.3.10.47disabled-source-ip-notify<domain>When sending through a proxy, the notification concerns the proxy’s client address, not the node’s local interface. § 3.3.1.23enable-tq-record-for-proxy-failure<domain>The second way to configure a proxy; its failures are recorded the same way. § 3.3.10.107enable-source-ip-limits-on-sending-ip<domain>The difference between the local and the outgoing address appears only where sending goes through a proxy — that is, where this directive is set. § 3.3.10.86
grep -rn 'smtp-proxy-source-host' /etc/pmta/
3 articles
◇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.◇The sending address — what it is made ofA named set of everything that is a property of the address: which IP the message leaves from, how the node introduces itself, what it signs with and how fast it sends.◇How the node responds to the receiving server's wordsMatches SMTP replies against regular expressions and changes the queue mode on a match — the very trigger that all of the backoff mode machinery waits for.