There are three login methods — LOGIN, PLAIN and CRAM-MD5. The last is always available when the AUTH command itself is enabled, and it does not send the password over the network: it is a response to a challenge, not a transfer of the secret.
Each name needs its own <smtp-user> block. Besides a password, login can be by system account (Linux only), via LDAP and by certificate.
Passwords are stored in the configuration in plain text. The manual names the reason directly: otherwise the full set of SASL mechanisms cannot be supported. And right away the only measure: the permissions on the configuration file must be as strict as possible. That is, the node’s configuration file is a password store, and anything that can read it reads them too: the configuration page in the web monitor, the file-based login of the HTTP API from chapter 8, a backup.
The advantage of CRAM-MD5 is half eaten away by this: the password does not travel over the network, but it sits on disk in the clear.
The second half of the mechanism is more interesting. A login is bound to a named source with the source directive, and that source’s settings override what the connection would have gotten by its address. Logins without their own source get the reserved {auth}.
This way rights and identity are assigned to a user, not to a place in the network. For a node used by several senders, this is the only working way to separate their rights.
A separate edge case is the web monitor: its configuration page shows the whole file. Whoever reaches the monitor has read the passwords, and no separate permission is needed for that.
The user sets the password in the cabinet; the Hub keeps it in an encrypted field of the working configuration and writes it to the node in plain text — otherwise the engine will not accept it.
🔴 All logins share one password. The names differ — pmtauser and one per pair — but the secret is shared across the node. So today the separation of logins is nominal: knowing one password, you can submit under any other login and choose any sending address on this node.
# a login, its source and the rights in it — three blocks working together <smtp-user shop-example-com> password s3cret-not-shared source {shop-example-com-auth} </smtp-user> <source {shop-example-com-auth}> smtp-service yes always-allow-relaying yes require-auth true default-virtual-mta shop-example-com </source>
what people get wrong and how it ends3 mistakes▶
§ 10.1.1
§ 10.1.1
our experience
3 relations
grep -n '^<smtp-user\|^ *source \|^ *require-auth' /etc/pmta/virtualhost.txt ls -l /etc/pmta/config /etc/pmta/virtualhost.txt
3 articles
◇How the node selects a source and combines its settingsA connection falls under all source blocks whose addresses cover it, and they act merged — the narrow one overrides the wide one; named blocks are attached only by direct reference.◇A license for a fleet, not for a serverThe license is not bound to a server: it is installed on as many machines as the instance limit allows, and the nodes send volume statistics to the vendor every hour.◇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.