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 need help in determining if this use case is possible:

  1. We have one primary mail server where we want certain email addresses to be stored from domainA.com

  2. All of the rest of the email addresses not defined on primary mail server, we want to be forwarded to a secondary server using secondary MX records (for same domainA.com)

Example: we have a domain which has several business email addresses (employees, sales, support, etc.) but on same domain we also have thousands of 'virtual' emails that we parse for our application. (we don't care about POP3 access etc. for the virtual addresses).

There is a service we are trying to use that can do all of the email parsing for us, but requires us to point our MX records to their server.

We want to be able to control our business emails on our own server, and only send the virtual emails to them.

Any suggestions, on how we can achieve this?

share|improve this question
    
It would help if you tell us what email servers you are using. –  John Gardeniers Feb 10 '10 at 12:00
    
Secondary MX records are for redundancy not routing purposes –  Jon Rhoades Feb 10 '10 at 12:07
add comment

1 Answer

Short of using a different domain name you are going to struggle.

Email works something like this (feel free to correct my mistakes):

  1. The sending Email client performs a DNS lookup on the domain part of the email address (everything to the right of the @).
  2. It will either get the IP address from a MX record, if there isn't one it just goes for the A record
  3. The email client opens a SMTP connection to the IP address it found in 2. and tries to deliver the email.
  4. The receiving server looks at the email address, it checks that it is accepting email for that domain and it may check if the account exist before accepting otherwise it just accepts the email.
  5. Only now is any routing done on the 'name' part of the email address (everything to the left of the @). The server then handles it according to whatever rules it has.

Consequently you can't use DNS and hence MX records to route email according to the 'name' part of the email address.


To potentially solve your problem - I don't see why your 'service' needs the MX record pointed at it (of course you may want a reverse DNS lookup or PTR record for SPAM purposes). Just set your MX record to point to a mail server you control and get it to forward on all of your 'virtual' email address to your service - it shouldn't care that they come from you and not the original sender.

Or change your staff email address to a different domain or subdoamin perhaps jon@admin.company.com?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.