2

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!

chmeee
  • 7,370
  • 3
  • 30
  • 43
Evgeny
  • 599
  • 3
  • 10
  • 17
  • 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 Answers3

1

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
David Smith
  • 418
  • 3
  • 5
1

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.

alexus
  • 13,112
  • 32
  • 117
  • 174
1

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.

Chris J
  • 1,218
  • 18
  • 32