We now return to the question of how qmail figures out what user handles each local delivery. Each local address is mapped to a set of user data including:
Qmail provides two schemes to find the user data. The preferred scheme is to use a static lookup table known as the users file. The table is a CDB file (Dan's Constant Data Base, designed for quick lookups) in /var/qmail/users/cdb, which is created from /var/qmail/users/assign by qmail-newu. For every local delivery, qmail-lspawn looks up the local part of the address in that file. If there's no match or the file doesn't exist (which it doesn't unless you create it), as a fallback it calls qmail-getpw, which invents user data on the fly from the system password database using the getpwnam( ) system library routine. Either way, qmail obtains an appropriate users entry for an address, which qmail-lspawn uses to perform the delivery. See Chapter 15 for more details on the users database. |