Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

setting up a simple mailserver to forward all messages sent to one address to gmail.

So far I have a file /var/qmail/mailnames/ with a single line:


I also have file /var/qmail/users/assign with:


test email bounces with error "Sorry, no mailbox here by that name."


share|improve this question
People still use qmail? I had to use it once, seemed very awkward to use. I'd suggest postfix or exim. – davr Jul 28 '09 at 22:20
I ended up using postfix, it was pretty easy to get going after I found location of the log file – Evgeny Jul 30 '09 at 17:01

I believe if you do that it will only do one domain whichever is default in /var/qmail/control, if you have multiple domains you should use vpopmail and on top I suggest you install QmailAdmin it'll help you with your forwarding among other useful things and it will be easier for you to manage through web gui.

share|improve this answer

Did you run qmail-newu? Did you include the "." as the last line of the file? Is /var/qmail/mailnames/ owned by localuser?

It might be simpler for you to just use the alias directory. Messages that don't match a user on the system get passed to the alias user (/var/qmail/alias) where they are handled as if the message were addressed to alias-localpart. In your case I think you would create this file:


And that file would contain your forwarding instructions:

share|improve this answer
thanks for the tip about newu tried all that. still no luck – Evgeny Jul 28 '09 at 23:10
You may need to restart qmail-send after creating the cdb file in /var/qmail/users/. I know you can replace a file while it's running, but if you create the file new while it's running you might have to restart. – David Smith Jul 28 '09 at 23:29
You don't need to restart when a cdb file is changed. Qmail reads it on the next pass. – Scott Lundberg Sep 21 '09 at 18:55
How would I create an alias for joining a Mailman mailing list? – Danijel Mar 20 '15 at 15:27

Can't adda comment (not enough reputation) but just want to confirm your paths -- I'm suspecting you've just swapped out the real-server name, but a sanity check is always a good thing :-)

Your users/assign file has a path of: /var/qmail/mailnames/

Whilst you say the .qmail file lives in: /var/qmail/mailnames/

i.e., vs.

The other thing to check is that the target directory and .qmail file are chown'd by uid:gid 2525:48 as configured in the assign file, and that the file is chmod'd 644.

qmail will generally setuid() to the target user's account. When you've configured users up in the users/assign file, qmail will setuid to the uid specified in there. So if perms aren't right, the user won't exist.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.