Postfix That Only Sends, And Only Encrypted

Postfix as a send-only relay: no local delivery (a stock install spools root's mail on the box), one smarthost, TLS required rather than opportunistic, SASL credentials in a root-only lmdb map, local recipients rewritten to a real mailbox. Original role, live-tested on Rocky Linux 10.

Verification

Live-tested

Really deployed to a container sandbox, proven idempotent (a second run changes nothing), verified against the role’s assertions, then torn down.

Conformance

  • Static validation (yamllint · ansible-lint)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live-tested - applied, verified, destroyed

Last verified 2026-09-19 · podman 4.9.3 · ansible 2.21.4 · how we verify

Documentation

postfix-null-client

Postfix as a send-only relay: nothing is delivered on the machine, everything goes to one smarthost, TLS is required, and the smarthost credentials are in a root-only map. Original role for EL 9 and 10, live-tested with podman on Rocky Linux 10.

A stock Postfix keeps your mail and sends in clear. Out of the box mydestination includes the host's own name, so mail for root@thishost - every cron failure, every local alert - is delivered into /var/spool/mail on the box, where nobody reads it. relayhost is empty, so everything else is sent straight to the destination's MX from the host's own address, which most receivers rate as spam. And smtp_tls_security_level = may sends in clear whenever the other side does not offer TLS. This role empties mydestination, sets local_transport to an error so local delivery is refused rather than spooled, points relayhost at your smarthost and sets the TLS level to encrypt, which refuses to send unencrypted.

Local recipients can be rewritten. Set postfix_null_client_root_alias and root, root@thishost and postmaster are rewritten to that mailbox before relaying, so a cron failure reaches a person. Leave it empty and such mail bounces, which is at least visible.

Credentials stay with root. The SASL map is written 0600 and rebuilt with postmap only when it changes; the role never logs its contents. The maps are lmdb:, not hash: - Enterprise Linux 9 and 10 build Postfix without Berkeley DB, and hash: there is "unsupported dictionary type", which the live test found on the first run.

License

Commercial - IaC Bazaar EULA. (c) IaC Bazaar.

Usage code & full reference need an account

The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.

  • Variables
  • Test

Related modules