Koozali.org: home of the SME Server

Qmail with - (hyphens) in mail aliases

Lasse Johansson

Qmail with - (hyphens) in mail aliases
« on: August 18, 2000, 02:35:54 PM »
As I've reported before, there is a limitation in using mail aliases in Qmail.

Now I have recieved a workaround from Peter Samuel , and after having tested it and found i work successfully, I would like to share this with this list.

First the workaround (quoted from Peter's mail):
*******************************************************************
qmail comes with an override mechanism that bypasses the /etc/passwd
lookup. qmail looks at a binary database file called
/var/qmail/users/cdb to find username override data. This file is
created from a plain text file called /var/qmail/users/assign.

So, to fix your problem:

Create /var/qmail/users/assign and add the following lines

=anna-lisa.smith:annalisa:502:503:/home/e-smith/files/users/annalisa:::
.

You MUST ensure that the last line of the file is a dot by itself. Change
502:503 to be the REAL user id and group id of annalisa.

Then run the command /var/qmail/bin/qmail-newu. If you've made a syntax
error, you'll see the following message

        qmail-newu: fatal: bad format in users/assign

If you don't run qmail-newu your changes will NOT take effect.
qmail-newu creates the cdb file from the assign file.

This will now override the username lookup mechanism and tell qmail that
all mail for anna-lisa.smith is handled by the user annalisa according
to the instructions in ~annalisa/.qmail.

Using this mechanism, there is no need to create special .qmail-whatever
files in home directories. (You can do this but it is more complex and
not necessary in this case).

The assign mechanism is very powerful. See

        man -M /var/qmail/man qmail-users

for more details.

We're thinking about how to integrate this feature into future
releases of the e-smith server.

Can you please try this fix and post results on the e-smith forum so
that other users can benefit from it.

*******************************************************************

My findings:

This works perfectly! You don't have to create the actual alias, - the /users/assign overrides this feature anyway... I've added several lines in the file /var/qmail/users/assign and that works as well

Big thanks to the quick help, and to Peter Samuel in particular!!!

//Lasse