01.06.2015 Views

SMTP Overview

SMTP Overview

SMTP Overview

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

temporary failures (but not too soon or too often) and giving up gracefully on permanent failures. (Tragically,<br />

there are improper clients out there in the world.)<br />

A <strong>SMTP</strong> conversation between the client and the server goes in stages, each one initiated by the client doing<br />

something. A typical conversation will look like:<br />

Client does:<br />

Connects to the server<br />

220 Helo there<br />

Server normally responds with:<br />

HELO client-hostname<br />

250 Pleased to meet you<br />

MAIL FROM:<br />

250 OK<br />

RCPT TO:<br />

(May be repeated)<br />

250 OK<br />

DATA<br />

354 Start mail input; end with .<br />

Sends the actual email message<br />

(Nothing, it's waiting for the . that ends the message)<br />

. 250 OK, accepted for delivery<br />

At this point the email message has been sent. The client can now disconnect with a QUIT command, or it can<br />

send another email message by starting with the MAIL FROM step again (optionally sending a RSET command<br />

first).<br />

The sender address is the email address that will receive email about delivery problems (mailing lists change<br />

this but not the From: email header so that they, and not the people sending to them, get messages about<br />

delivery problems). A special null sender address (MAIL FROM:) is used to signal that no one cares and no<br />

bounce notifications should be sent. Null senders are used when sending bounce messages themselves, and<br />

sometimes at other times.<br />

There can be multiple recipients of the same message on the same computer. So that the actual email message<br />

only has to be transfered once (saving bandwidth), there can be several RCPT TOs for a message. (There has to<br />

be at least one, just like there has to be a MAIL FROM.) The client has to keep track of which recipient addresses<br />

have problems, if any, and retry them later if necessary.<br />

The envelope headers are the MAIL FROM and RCPT TO parts of the <strong>SMTP</strong> conversation. The envelope sender is<br />

the MAIL FROM address, and the envelope recipients are the RCPT TO addresses.<br />

The client-hostname, the sender address, and the recipient addresses should all be fully qualified. A fully<br />

qualified host or domain name is one that anyone on the Internet could use to look up information, not a<br />

shortened name useful only on machines inside an organization; for example, server.example.com instead of<br />

just server. A fully qualified email address is an email address with a fully qualified host or domain name, not<br />

just an email login; for example, MAIL FROM: instead of MAIL<br />

FROM: or MAIL FROM:. If the host or domain name is left off an email<br />

address, the <strong>SMTP</strong> server usually has no choice but to interpret it as an address on itself.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!