You are not logged in.

#1 2014-05-15 16:20:45

slakam
Member
Registered: 2014-01-31
Posts: 3

How to send mail for a certain domain to a different box

Hello,

I have domain foo.com pointing to a VPS, but I want all @foo.com mail to be sent to my mail server moo.com on a different VPS. I believe this is done with DNS records but I have no clue as to what's the right way to do it.

Any help will be much appreciatted.

Thanks.

Last edited by slakam (2014-05-15 16:21:19)

Offline

#2 2014-05-16 01:00:28

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: How to send mail for a certain domain to a different box

Are you by chance trying to get email notifications about activity on your VPS sent to your mail server instead of your VPS user account? I know that's possible. I've never actually done it, though; I've seen information floating around about using something like s-nail + msmtp to accomplish that.

Otherwise, if you're looking to route mail sent to foo.com to a server other than your VPS, you need to add MX (and possibly TXT) records to your DNS settings. How that is done depends entirely on who your DNS providers are for the VPS and for mail server, and instructions should be detailed on those providers' websites. Just to be clear, though, to my knowledge if your mail server is using a different registered domain name than the email address this probably won't work; it should work fine if the mail server is using a subdomain, such as mail.foo.com. Mail addressed to one domain can only be sent to a server at another domain by setting up a mail server for each domain---one to receive and forward mail, the other to receive the forwarded mail. In short, if you want mail to be sent to moo.com instead of foo.com, the best option would be to not have people send mail to foo.com.

Offline

#3 2014-05-18 18:40:50

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: How to send mail for a certain domain to a different box

ANOKNUSA wrote:

Are you by chance trying to get email notifications about activity on your VPS sent to your mail server instead of your VPS user account? I know that's possible. I've never actually done it, though; I've seen information floating around about using something like s-nail + msmtp to accomplish that.

Otherwise, if you're looking to route mail sent to foo.com to a server other than your VPS, you need to add MX (and possibly TXT) records to your DNS settings. How that is done depends entirely on who your DNS providers are for the VPS and for mail server, and instructions should be detailed on those providers' websites. Just to be clear, though, to my knowledge if your mail server is using a different registered domain name than the email address this probably won't work; it should work fine if the mail server is using a subdomain, such as mail.foo.com. Mail addressed to one domain can only be sent to a server at another domain by setting up a mail server for each domain---one to receive and forward mail, the other to receive the forwarded mail. In short, if you want mail to be sent to moo.com instead of foo.com, the best option would be to not have people send mail to foo.com.

If you set up a mail server with virtual domains/mailboxes, it is no problem to handle mail from numerous different domains. I have just one mailserver at my main domain, but the MX records of several other domains points to it. You just need to include those domains in the virtual domains list (or database)

Offline

Board footer

Powered by FluxBB