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:
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!
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:
And that file would contain your forwarding instructions:
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.
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.