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.

Would someone please show me the overview of how multiple mx for a single domain is set up to communicate with each other?

I am not talking about how to configure the postfix or DNS mx entries, I am talking about the network diagram and the sequence of communication events that takes place during a send and recieve.

I tried to figure out from some ISP mail settings, for example:

  1. pop.qiye.163.com -- 2 IPs (subnet 1)
  2. mx1.qiye.163.com -- 2 IPs (subnet 1)
  3. mx2.qiye.163.com --- 3 IPs (subnet 2)

How does or why is it that when connected to pop.qiye.163.com, user can fetch mail from both mx1 and mx2? Which software faciliates the "gathering of mails from multiple servers?" If pop.qiye.163.com is down, doesn't that mean the user still cannot access the mails even if both mx are up? Any difference with IMAP?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You have two types of servers involved here. There is not gathering as such going on, just normal mail transfers.

mx1 and mx2 are MTAs (Mail Transfer Agents). They are responsible for accepting email and delivering it towards the final destination. In the case of incoming email, they will forward it to pop if that is the MDA (Message Delivery Agent) for the user. All other email will will be forwarded to an appropriate server if possible. These servers will store email and retry delivery if necessary.

pop is an MDA and is responsible for storing and delivering email for the user. As an MDA it will not forward email to an MTA. It appears to be a POP server and will have a message store for each user it is responsible for. When the user's UA (User Agent) connects to pop they can only read email which has already been delivered. It is possible that mx1 and mx2 will be holding email which could not be delivered for some temporary reason (pop is down, user has exceeded quota, etc.).

Users of pop will likely have been given an SMTP address to be used when sending email. This server will function as an MSA (Mail Submission Agent) when the users connect. Its task is to authenticate the user (local users may not need to login), and add any required headers that the user's UA (User Agent) failed to add. The message will then be sent to the appropriate MX or possibly directly to an MDA.

It is common for MX servers to act as an MDA or MSA. Here are some diagrams which might help understand the routing for incoming email.

email ---+---> mx1 ---+---> pop ---> UA
         +---> mx2 ---+

In your example, email destined for pop is deliverer either mx1 or mx2. Which ever MX receives the mail forwards it to pop when possible (usually immediately). pop stores the mail until the user's UA connects and reads the mail. Depending on the pop setting email is deleted when read. Neither mx1 nor mx2 needs to be up when email is read. However, as pop is the MDA and has the email to be read, it must be up when you want to read email. The user will read only email which has been delivered to pop and will not be fetching or gathering email from mx1 or mx2.

UA ---> MSA ---+---> MX ----+---> MXs ---+  
               +------------+------------+---> MDA ---> UA

Outgoing email goes from the user's UA to smtp, its MSA. The MSA sends the email to an MX (possibly mx1 or mx2), or directly to an MDA like pop. The MX may tranfer the email through additional MXs until it reaches and MDA which accepts the email for delivery. If at any step along the way, the email is determined to be undeliverable, it will be returned to sender if possible. At some point a UA may be used to read the email.

share|improve this answer
    
Thanks! I wish I could up vote more! Appreciate that you understood my question eventhough it could have been badly formed due to my lack of knowledge. e.g. existing infrastructure does not "gather" or "pull", but rather MTAs "forward" or "push" emails to MDA. That's why it was put in qoutes from onstart. –  Jake Nov 7 '11 at 3:57
add comment

Your question doesn't make sense.

MX servers are for receiving mails. They store mails on a central mailbox storage (hopefully). This mailbox store is then available via POP3 and/or IMAP4.

You can also set it up as follows. If your first (primary) MX is down the second (backup) MX will queue all mails locally until the first MX is up again. It will then forward all mails to the first one. This is also a "one mailbox store" scenario.

So there is no "gathering of mails".

share|improve this answer
    
Thanks mailq. The "gathering" I was asking about is the central mailbox or forwarding that you said. But in the former case, where is this central store located normally? Is it on a different server entirely? What if this central store server is down? –  Jake Nov 6 '11 at 19:48
2  
@Jake This is not a discussion forum. Central storage doesn't mean that it isn't redundant (e.g DRBD). How you set up your infrastructure is solely your "problem". You can have all (SMTP, storage, POP3) on one server or on several. It is always a question of security, costs, complexity and redundancy. But technically solvable. –  mailq Nov 6 '11 at 20:17
    
Sorry if I wasn't clear but BillThor got exactly what I needed. I wasn't trying to discuss, because I am not good enough, I was just hoping you can tell me how it work. For example bill confirms "... as pop is the MDA and has the email to be read, it must be up when you want to read email..." cos' there's a lot of talk about multiple mx but very few multiple pop so I wasn't sure if I understood the situation correctly. that's why I asked. –  Jake Nov 7 '11 at 3:53
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.