10.6 The Users Database

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:

  • Username

  • Numeric user ID

  • Numeric group ID

  • Home directory

  • Character to separate parts of a subaddress, usually a dash

  • Extension, used to find an appropriate .qmail file

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.



qmail
qmail
ISBN: 1565926285
EAN: 2147483647
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net