The qmail-lspawn
program is given delivery commands for local messages. Each delivery command consists of a message number, a sender, and a recipient. It uses first the qmail-users mechanism and, if necessary, the qmail-getpw
program (the qmail interface to UNIX system users) to locate the home directory and other relevant details about each recipient. Then qmail-lspawn
spawns a qmail-local
instance to deliver to that user. The qmail-local
instance is spawned asynchronously, so the actual deliveries can occur in any order. In order to execute deliveries safely and securely, the qmail-local
program must run with the UNIX User Identification Number (UID) and UNIX Group Identification Number (GID) of the recipient. Thus, qmail-lspawn
must run as the root user, so that when spawning the qmail-local
program to do the delivery, qmail-lspawn
can change to the necessary UID.
One thing to note is that because qmail-lspawn
runs as root and qmail-local
runs as the user to...