How Mail Is Sent and Received

When mail is sent to a user, many things have to happen behind the scenes. Here we take an example of Roger sending an email to Justin at different domains.

1. Roger, being 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].

In This Chapter

Sending mail via SMTP Configuring Postfix Configuring Qpopper Configuring Cyrus

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.

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 20, we talk more about 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 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.

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).

Once 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 allow the user 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?

0 0

Post a comment