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

I have a Linux VPS and a hosted exchange server from somewhere else. I can receive emails from my exchange server if I point mx entry on my VPS to exchange server. But if I point mx entry, same account on my VPS does not get emails. Yes this is how it works, I know. Is there a way to get emails on both remote exchange mail server and my local VPS? Is there any DNS settings for this? Basically I want to do something like mirroring.

share|improve this question
    
are you running a mail server on the Linux VPS? There is nothing in DNS that will help you if there is no mail server running. –  EasyEcho Sep 30 '09 at 13:28
    
You want emails to be duplicated? Each mail sent twice to both email servers? If so, there is not DNS solution. –  bortzmeyer Oct 2 '09 at 9:38
add comment

3 Answers

up vote 1 down vote accepted

Unfortunately MX records do not work like that. You can specify multiple MX records for redundancy, should one server fail, but you will only get mail delivered to one server.

MX records work on a system of priority, so smtp servers will attempt to send mail to the MX record with the lowest priority first, then if they cannot, the next and so on. If you have multiple MX records with the same priority then it will pick a record at random manor, in a similar way to round robin DNS. Once it has delivered mail, it will not try any more.

If you want to get mail delivered to both servers, I would suggest using one as primary and receiving all mail, and then forwarding on to the other. You can set the secondary mail server with an MX record priority higher than the primary so that should the primary fail all mail will go to the secondary.

share|improve this answer
    
So how can we forward all incoming emails to the other server? Like forward all emails to this IP address and there exchange will take care of it. –  Ergec Sep 30 '09 at 12:14
add comment

well, there is an easy option if you front end with postfix by using the always_bcc option...

from http://www.postfix.org/postconf.5.html:

always_bcc (default: empty)

Optional address that receives a "blind carbon copy" of each message that is received by the Postfix mail system.

Note: if mail to the BCC address bounces it will be returned to the sender.

Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated for mail that Postfix forwards internally, nor for mail that Postfix generates itself.

Additionally, you could setup canonical and transport mappings for forwarding in a similar manner.

share|improve this answer
add comment

"Does not get emails" is a very useless report. What did you do and what was the result? The error messages? Did you get a bounce? If so, post it. Etc...

As EasyEcho said, the second step is to have a mail server on the Linux VPS. (The first step being to decide on your addressing plan: choose the domain names for the addresses that will go to Exchange and those for the addresses that will go to the Linux VPS.) When it is done, tell us the make.

share|improve this answer
add comment

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.