Postfix unprivileged master(8) operation

Summary

This document describes a proof of concept that may be used for experiments to run the Postfix master(8) daemon without "root" privileges (and consequently, all Postfix daemon processes). As discussed below, this will make Postfix less secure.

The remainder of this document is organized as follows:

Postfix privileged security model, and impact from unprivileged operation

This section summarizes the Postfix security model for privileged master(8) operation, and how it is weakened with an unprivileged master(8).

Routine Postfix management: start, stop, reload, configuration

The following instructions assume that the steps in the " Appendix have already been implemented.

Postfix configurations MUST NOT be owned by the postfix user: that would be too convenient for someone who compromises a Postfix daemon process.

Credits

Appendix

Build requirements

Unprivileged master(8) operation requires that Postfix is built with dynamically-linked libraries, that is, with "shared=yes" on the "make makefiles" command line.

One-time changes required after initial Postfix installation

After installing Postfix from a standard pre-compiled package or from source code, a few tweaks are needed to make unprivileged operation possible. These changes should persist after subsequent Postfix updates.

To revert to the privileged Postfix operation, stop Postfix and undo the changes described in the subsections that follow.

Update maillog_file permissions

Update the import_environment parameter setting

Change the "pid" lockfile directory ownership

Make TLS secret key files world-readable

Normally, Postfix daemons open secret key files before dropping "root" privileges. With unprivileged Postfix that is no longer possible.