NAME
makeuserdb - create /etc/courier/userdbSYNOPSIS
makeuserdb
[-f filename]
pw2userdb
vchkpw2userdb
[--vpopmailhome= dir] [--todir=dir]
DESCRIPTION
makeuserdb creates /etc/courier/userdb.dat from the contents of /etc/courier/userdb. /etc/courier/userdb's contents are described later in this document. Maildrop, Courier, and other applications use /etc/courier/userdb.dat as a substitute/complement for your system password file. The usual purpose for /etc/courier/userdb.dat is to specify "virtual" accounts - accounts that do not have an associated system login. Usually (but not necessarily) all virtual accounts share the same system userid. /etc/courier/userdb.dat may also replace your system password file. Because the system password file is a text file, when there's a large number of accounts it will be significantly faster to search @userdb.dat@, which is a binary database, instead of a flat text file that the system password file usually is. The makeuserdb command can be safely executed during normal system activity. The -f option creates filename.dat from filename, instead of the default /etc/courier/userdb.dat from /etc/courier/userdb.Format of /etc/courier/userdb
/etc/courier/userdb is a plain text file that can be created using any text editor. Blank lines are ignored. Lines that start with the # character are comments, and are also ignored. Other lines define properties of a single "account", one line per account. /etc/courier/userdb may be a directory instead of a plain file. In that case all files in /etc/courier/userdb are essentially concatenated, and are treated as a single file. Each line takes the following format:name<TAB>field=value|field=value...
/etc/courier/userdbshadow.dat
All fields whose name ends with 'pw' will NOT copied to /etc/courier/userdb.dat. These fields will be copied to /etc/courier/userdbshadow.dat. makeuserdb creates /etc/courier/userdbshadow.dat without any group and world permissions. Note that makeuserdb reports an error if /etc/courier/userdb has any group or world permissions.CONVERTING /etc/passwd and vpopmail to /etc/courier/userdb format
pw2userdb reads the /etc/passwd and /etc/shadow files and converts all entries to the /etc/courier/userdb format, printing the result on standard output. The output of pw2userdb can be saved as /etc/courier/userdb (or as some file in this subdirectory). Linear searches of /etc/passwd can be very slow when you have tens of thousands of accounts. Programs like maildrop always look in /etc/courier/userdb first. By saving the system password file in /etc/courier/userdb it is possible to significantly reduce the amount of time it takes to look up this information. After saving the output of pw2userdb, you must still run makeuserdb to create /etc/courier/userdb.dat. vchkpw2userdb converts a vpopmail-style directory hierarchy to the /etc/courier/userdb format. This is an external virtual domain management package that's often used with Qmail servers. Generally, an account named 'vpopmail' is reserved for this purpose. In that account the file users/vpasswd has the same layout as /etc/passwd, and performs a similar function, except that all userid in users/vpasswd have the same userid. Additionally, the domains subdirectory stores virtual accounts for multiple domains. For example, domains/example.com/vpasswd has the passwd file for the domain example.com. Some systems also have a soft link, domains/default, that points to a domain that's considered a "default" domain. The vchkpw2userdb reads all this information, and tries to convert it into the /etc/courier/userdb format. The --vpopmailhost option specifies the top level directory, if it is not the home directory of the vpopmail account. The vchkpw2userdb script prints the results on standard output. If specified, the --todir option tries to convert all vpasswd files one at a time, saving each one individually in dir. For example:mkdir /etc/courier/userdb vchkpw2userdb --todir=/etc/courier/userdb/vpopmail makeuserdb
FILES
/etc/courier/userdb /etc/courier/userdb.dat /etc/courier/userdbshadow.dat /etc/courier/userdb.tmp - temporary file /etc/courier/userdbshadow.tmp - temporary file
BUGS
makeuserdb is a Perl script, and uses Perl's portable locking. Perl's documentation notes that certain combinations of locking options may not work with some networks.SEE ALSO
userdb(8)[3], maildrop(8)[4], courier(8)[5], maildirquota(7)[2].NOTES
- 1.
- userdbpw(8)
[set
$man.base.url.for.relative.links]/userdbpw.html
[set
$man.base.url.for.relative.links]/maildirquota.html
- 3.
- userdb(8)
[set
$man.base.url.for.relative.links]/userdb.html
- 4.
- maildrop(8)
[set
$man.base.url.for.relative.links]/maildrop.html
- 5.
- courier(8)
[set
$man.base.url.for.relative.links]/courier.html
10/28/2020 | Double Precision, Inc. |