When mail is sent to a user, many things have to happen behind the scenes. Here we take an example of Roger sending an e-mail to Justin at different domains.
1. Roger, a KDE user, uses kmail to compose a message to [email protected]. Roger's mail configuration states that his SMTP (outbound) mail server is mail.disruptive.org.uk, so kmail connects over port 25 (SMTP) to the host and attempts to send the mail to [email protected].
2. When connected, Roger's mail server checks the sanity of the connection and the mail itself (which is discussed later in this section). All being well, the mail is accepted, and Roger's mail server then attempts to send the mail to its final recipient, Justin.
3. Roger's mail server knows that mail for palmcoder.net is not handled by its local MTA and proceeds to do an MX lookup for palmcoder.net.
An MX is a Mail Exchange domain name system (DNS) record that points to the mail server for palmcoder.net. The MX record is the backbone of Internet mail and provides a means for any domain to be resolved to a specific host that handles mail for it.
In the case of [email protected], the DNS MX record is MX 10 mail.palmcoder.net.
In Chapter 21, we discuss in greater detail how a DNS record works, but for now, realize that the MX record for palmcoder.net points to mail.palmcoder.net.
Going back to Roger's mail server — once an MX record has successfully been retrieved, the mail server attempts to connect to mail.palmcoder.net over port 25 and deliver Roger's original e-mail to Justin. The same sanity checks take place by Justin's mail server as to whether it should accept the mail connection and the mail recipient given in the SMTP negotiation.
5. As the mail is destined for [email protected], Justin's mail server accepts the connection and delivers the mail to Justin's mailbox locally (or to another process, depending on how your mail server is configured).
After mail has been delivered to your mailbox, it is stored until you retrieve it. It is the MDA that actually presents the mail to the user for retrieval. Do not confuse your mail client with an MDA; it is used only to retrieve your mail and to read it!
Popular MDAs are POP3 and IMAP; these two protocols enable users to log in to a mail server and retrieve their messages, as an MDA should do. These are discussed later in the chapter.
Was this article helpful?