from small one page howto to huge articles all in one place

search text in:

What does your sytem tell when running "ulimit -u"?

poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs






average rating: 1.7 (82 votes) (1=very good 6=terrible)

May 25th. 2007:




why adblockers are bad

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels






average rating: 1.3 (27 votes) (1=very good 6=terrible)

April, 26th. 2006:

You are here: manpages


Section: Double Precision, Inc. (8)
Updated: 08/25/2013
Index Return to Main Contents


makeuserdb - create /etc/courier/authlib/userdb  


makeuserdb [-f filename]
vchkpw2userdb [--vpopmailhome=dir] [--todir=dir]



creates /etc/courier/authlib/userdb.dat from the contents of /etc/courier/authlib/userdb. /etc/courier/authlib/userdb's contents are described later in this document. Maildrop, Courier, and other applications use /etc/courier/authlib/userdb.dat as a substitute/complement for your system password file. The usual purpose for /etc/courier/authlib/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/authlib/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/authlib/userdb.dat from /etc/courier/authlib/userdb.  

Format of /etc/courier/authlib/userdb

/etc/courier/authlib/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/authlib/userdb may be a directory instead of a plain file. In that case all files in /etc/courier/authlib/userdb are essentially concatenated, and are treated as a single file. Each line takes the following format:


name is the account name. name MUST contain only lowercase characters If Courier is configured to treat lowercase and uppercase account names as identical, name is followed by exactly one tab character, then a list of field/value pairs separated by vertical slashes. field is the name of the field, value is the field value. Fields and values themself cannot contain slashes or control characters. Fields may be specified in any order. Here are all the currently defined fields. Note that not every field is used by every application that reads /etc/courier/authlib/userdb.dat.

uid - value is a (possibly) unique numerical user ID for this account.

gid - value is a (possibly) unique numerical group ID for this account.

home - value is the account's home directory.

shell - value is the account's default login shell.

systempw - value is the account's password. See m[blue]userdbpw(8)m[][1] for details on how to set up this field.

pop3pw, esmtppw, imappw... - value specifies a separate password used only for authenticating access using a specific service, such as POP3, IMAP, or anything else. If not defined, systempw is always used. This allows access to an account to be restricted only to certain services, such as POP3, even if other services are also enabled on the server.

mail - value specifies the location of the account's Maildir mailbox. This is an optional field that is normally used when userdb is used to provide aliases for other mail accounts. For example, one particular multi-domain E-mail service configuration that's used by both Qmail and Courier servers is to deliver mail for a mailbox in a virtual domain, such as "", to a local mailbox called "example-user". Instead of requiring the E-mail account holder to log in as "example-user" to download mail from this account, a userdb entry for "" is set up with mail set to the location of example-user's Maildir mailbox, thus hiding the internal mail configuration from the E-mail account holder's view.

quota - value specifies the maildir quota for the account's Maildir. This has nothing to do with actual filesystem quotas. Courier has a software-based Maildir quota enforcement mechanism which requires additional setup and configuration. See m[blue]maildirquota(7)m[][2] for additional information.  


All fields whose name ends with 'pw' will NOT copied to /etc/courier/authlib/userdb.dat. These fields will be copied to /etc/courier/authlib/userdbshadow.dat. makeuserdb creates /etc/courier/authlib/userdbshadow.dat without any group and world permissions. Note that makeuserdb reports an error if /etc/courier/authlib/userdb has any group or world permissions.  

CONVERTING /etc/passwd and vpopmail to /etc/courier/authlib/userdb format

pw2userdb reads the /etc/passwd and /etc/shadow files and converts all entries to the /etc/courier/authlib/userdb format, printing the result on standard output. The output of pw2userdb can be saved as /etc/courier/authlib/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/authlib/userdb first. By saving the system password file in /etc/courier/authlib/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/authlib/userdb.dat.

vchkpw2userdb converts a vpopmail-style directory hierarchy to the /etc/courier/authlib/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/ has the passwd file for the domain 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/authlib/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/authlib/userdb
vchkpw2userdb --todir=/etc/courier/authlib/userdb/vpopmail

It is still necessary to run makeuserdb, of course, to create the binary database file /etc/courier/authlib/userdb.dat

NOTE: You are still required to create the /etc/courier/authlib/userdb entry which maps system userids back to accounts, "uid=<TAB>name", if that's applicable. vchkpw2userdb will not do it for you.

NOTE: makeuserdb may complain about duplicate entries, if your "default" entries in users/vpasswd or domains/default/vpasswd are the same as anything in any other /etc/courier/authlib/userdb file. It is also likely that you'll end up with duplicate, but distinct, entries for every account in the default domain. For example, if your default domain is, you'll end up with duplicate entries - you'll have entries for both user and

If you intend to maintain the master set of accounts using vchkpw/vpopmail, in order to avoid cleaning this up every time, you might want to consider doing the following: run vchkpw2userdb once, using the --todir option. Then, go into the resulting directory, and replace one of the redundant files with a soft link to /dev/null. This allows you to run vchkpw2userdb without having to go in and cleaning up again, afterwards.  


/etc/courier/authlib/userdb.tmp - temporary file
/etc/courier/authlib/userdbshadow.tmp - temporary file


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.  


m[blue]userdb(8)m[][3], m[blue]maildrop(8)m[][4], m[blue]courier(8)m[][5], m[blue]maildirquota(7)m[][2].  


[set $man.base.url.for.relative.links]/userdbpw.html
[set $man.base.url.for.relative.links]/maildirquota.html
[set $man.base.url.for.relative.links]/userdb.html
[set $man.base.url.for.relative.links]/maildrop.html
[set $man.base.url.for.relative.links]/courier.html



Format of /etc/courier/authlib/userdb
CONVERTING /etc/passwd and vpopmail to /etc/courier/authlib/userdb format

Please read "Why adblockers are bad".

Other free services
Shorten long
URLs to short
links like
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2013 Sascha Nitsch Unternehmensberatung UG(haftungsbeschränkt)
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 3.8 ms