Courier User writes:
various attributes such as uid, gid, home directory, system
password, etc. But I'm curious about the purpose of the second
line, which looks like this:
NNNN= UUUU
where UUUU is the username and NNNN is the uid associated with that
username.
I presume that this line exists in addition to the "uid=UUUU" entry
in the first line so that there is a two-way mapping between
usernames and uid's (i.e., so that the username can be looked up by
uid as readily as the uid can be looked up by username).
Correct.
But my question is this: for what does Courier use this reverse
uid=>username mapping? Can I leave this line out, or will something
critical break without it?
This is used by the standalone version of maildrop (not the maildrop build
that's included with Courier).
For a hypothetical user named "user" at a virtual domain
"virtdomain.com", where "virtdomain.com" is in hosteddomains, I know
that the first line of the two-line combination in userdb should
look like this:
us...@virtdomain.com uid=1111|gid=1111|home=/home/user|[...]
But in this case, should the second line be number 1 or number 2?
1. 1111= user
2. 1111= us...@virtdomain.com
Neither. This facility exists so that the GDBM-based userdb can completely
eliminate the needed for passwd file lookups. So that after using pw2userdb
everything can now be handled via the userdb database lookup, instead of
scanning the sequential passwd file.
Obviously this is not applicable to virtual domain situations.