Electronic Mail
One of the most prominent uses of networking since the first networks were devised, has been electronic mail.
It started as a simple service that copied a file from one machine to another, and appended it to the recipient's mailbox file.
Mail Message
A Mail message consists of:
message body, which is the text the sender wrote.
special data specifying recipients, transport medium, etc...
This special data falls into two categories:
Any data that is specific to the transport medium, like the address of sender and recipient.
It is therefore called the envelope.
It may be transformed by the transport software as the message is passed along.
Any data necessary for handling the mail message, which is not particular to any transport mechanism, such as the message's subject line, a list of all recipients.
It has become standard to prepend this data to the mail message, forming the so-called mail header. It is offset from the mail body by an empty line.
Standards:
RFC-822 - Standard used by sites on the Internet.
MIME - New standard for multi-media mail, it deals with including pictures and sound in mail messages.
Common header fields:
From: This contains the sender's email address.
To: This is the recipient's email address.
Subject: Describes the content of the mail in a few words.
Date: The date the mail was sent.
Reply-To: Specifies the address the sender wants the recipient's reply directed to.
Organization: The organization that owns the machine from which the mail originates.
Message-ID: A string generated by mail transport on the originating system. It is unique to this message.
Received: Every site that processes your mail inserts such a field into the header, giving its site name, a message id, time and date it received the message, which site it is from, and which transport software was used. This is so that you can trace which route the message took.
X-anything: No mail-related programs should complain about any header which starts with X. It is used to implement additional features that have not yet made it into an RFC, or never will.
Mail Delivering
MUA - Mail User Agents:
Mailer interface like elm, pine, Netscape Mail, that can compose mail messages.
MTA - Mail Transport Agents:
The program that the MUA hands the e-mail for delivery, like sendmail, smail.
Kinds of delivery:
Local:
The local MTA will process the mail and append it to the incoming message to the recipient's mailbox.
Remote by Internet:
The mail is delivered over a network using TCP/IP, SMTP is commonly used:
SMTP stands for Simple Mail Transfer Protocol, and is defined in RFC-788 and RFC-821.
SMTP usually connects to the recipient's machine directly, negotiating the message transfer with the remote side's SMTP daemon.
Remote by UUCP:
In UUCP networks, mail will usually not be delivered directly, but rather be forwarded to the destination host by a number of intermediate systems.
Email Addresses
For electronic mail, an address is made up:
the name of a machine handling the person's mail,
and a user identification recognized by this system.
Mail Routing on the Internet
The default is to deliver the message to the destination host directly by looking up its IP address, and leave the actual routing of the data to the IP transport layer.
Mail Exchanger:
Most sites will usually direct all in-bound mail to a highly available mail server that can act as a mail forwarder for all machines in this domain.
Mail Exchangers may also be used to handle traffic for hosts that are not connected to the Internet themselves, like UUCP networks, or company networks with hosts carrying confidential information.
Example:
An organization, say Foobar Inc., want all their mail handled by their machine called mailhub. They will then have an MX (Mail Exchanger) record like this in the DNS database:
foobar.com IN MX 5 mailhub.foobar.com
This announces mailhub.foobar.com as a mail exchanger for foobar.com . A host that wishes to deliver a message to joe@greenhouse.foobar.com will check DNS for foobar.com, and finds the MX record pointing at mailhub. The message will be delivered to mailhub, which then dispatches it to greenhouse.