<smtp-listener>
The line names the <source> block whose settings apply to connections accepted at this listener’s address. The manual describes the result in one word: they override what matching by the sender’s address would have given.
There is no default: if it is not written, the usual matching applies.
The same can be written as a parameter right in the node-level listener line (smtp-listener 1.2.3.4:25 source=mta1) — these are two forms of one setting.
What it is for: separating ports. One port accepts submission with broad rights, another accepts inbound mail, where relaying is forbidden and only receiving complaints is allowed.
So all address-based restrictions for this port have to be set either in the named block itself or as a range in the listener’s address.
The difference is significant: for us rights are tied to the account and apply from any address, whereas this directive would tie them to a port.
What to set. The value is a block name; the question is what to separate rights by:
| Value | When |
|---|---|
| do not write it | rights are separated by login or by address — the usual case |
| a block name | ports have different roles: submission on one, inbound mail on another |
If the line is needed, the named block must contain the full set of rights for this port: we do not advise relying on missing settings coming from address blocks.
# the complaint receiving port has its own rights: relaying is forbidden <source inbound-only> smtp-service yes max-message-size 30M </source> <smtp-listener 0/0:25> source inbound-only</smtp-listener>
what people get wrong and how it ends2 mistakes▶
§ 3.3.17.3
our experience
3 relations
grep -n 'smtp-listener\|^ *source ' /etc/pmta/config printf 'HELO test\r\nMAIL FROM:<a@example.com>\r\nRCPT TO:<b@example.net>\r\nQUIT\r\n' | nc <node-address> 25
3 articles
◇Who is allowed to submit mail and for whom to accept itOut of the box, the node accepts submission only from the machine itself; two different questions — “who can send through us” and “for whose addresses we accept mail” — are answered by different directives.◇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.◇The load balancer header at the entranceThe node reads the PROXY header at the start of an incoming connection and treats the address from it as the source; this works for both kinds of entry point.