Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

So far I have a file /var/qmail/mailnames/myserver.com/username/.qmail with a single line:

&recepient@gmail.com

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

=username:localuser:2525:48:/var/qmail/mailnames/servername.com/username:::

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

Thanks!

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

3 Answers 3

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/myserver.com/username/ 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:

/var/qmail/alias/.qmail-username

And that file would contain your forwarding instructions:

&recipient@gmail.com
share|improve this answer
    
thanks for the tip about newu tried all that. still no luck –  Evgeny Jul 28 '09 at 23:10
1  
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

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/servername.com/username

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

i.e., myserver.com vs. servername.com.

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

 
discard

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.