johnsimer
johnsimer

Reputation: 350

Why must SMTP User agents send mail through a mail server?

My networking teacher said the SMTP messaging process from Alice to Bob goes through this process.

(1) User agent -> (2) Alice's Mail server - > (3) Bob's mail server -> (4) Bob's User Agent

Let's say Alice is on her User Agent (e.g. Thunderbird). Why does her email have to go through a mail server? Why couldn't she send a message directly to bob's mail server? If her user agent knows Bob's address ([email protected]), couldn't her user agent do some sort of DNS lookup to figure out the IP address for gmail.com and send her SMTP message directly to Bob's mail server?

Upvotes: 3

Views: 2649

Answers (3)

mhaseebmlk
mhaseebmlk

Reputation: 222

Unlike HTTP, SMTP is a 'push' protocol. An HTTP client 'pulls' data from an HTTP server. On the other hand, a mail client (in this case Alice), 'pushes' the email using Simple Mail Transfer Protocol (SMTP) to a mail server running SMTP. The mail server then pushes this email to Bob's mail server.

Now, when Bob wants to check his email, he does NOT use SMTP, but uses another protocol like IMAP/POP to get his new email and display on his user agent.

If Alice were to send an email directly to Bob, Bob's user agent would have to be always on (much like a server). But, since Bob is just another client that can be off, Alice's email would not be able to reach Bob in case Bob's user agent was off. Therefore, a mail server would store Alice's email to Bob and when Bob's user agent is on, it can retrieve the new email. Hence, the need for mail to be sent via mail servers.

Upvotes: 2

ashu82492
ashu82492

Reputation: 66

If we consider a case where Bob's mail server is not reachable then Alice does't have any option except sending that e-mail to Alice's mail server.

If Alice deposit e-mail to it's mail server, then Alice's mail server will keep trying to send e-mail to Bob's mail server until it's become reachable.

As you mentioned if we try to send e-mail directly to Bob's mail server then Alice will have to keep sending by herself that e-mail repetitively until Bob's mail server become reachable and as a user you don't want that.

Upvotes: 2

AnFi
AnFi

Reputation: 10913

Email transfers are usually simple. Number of "special cases" may be huge.

  1. Sending via local mail/SMTP server makes User/Mail Agent simpler. It lowers chances of hitting "special cases" before passing responsibility for email delivery. It helps to avoid "unstable" behavior.

  2. Sending directly to recipient's mail server is even more complicated and risky in spam era.

Some servers drop "classified as spam" messages without any notification whatsoever. Without it I might recommend "advanced users" using local mail server as fall back delivery route when initial direct delivery fails in SMTP session.

If you have fixed IP address without blocked outgoing SMTP connections you may set your own mail/SMTP server. It makes market for (over) complicated mail agents even smaller.

Upvotes: 1

Related Questions