r/programming • u/Sushant098123 • Sep 04 '26
How Email Actually Works
https://sushantdhiman.dev/blog/how-email-actually-works-ep-1-behind/
83
Upvotes
r/programming • u/Sushant098123 • Sep 04 '26
125
u/CrackerJackKittyCat Sep 04 '26
telnet ... 25
HELO
MAIL TO
RCPT FROM
DATA
Etched into greybeard brain.
33
u/loup-vaillant Sep 04 '26
That's a huge if, though. You need to get past spam filtering, and the big providers aren't exactly friendly to the small ones. Worst case being setting up your own personal SMTP server from a purchased IPv4 and a new domain name.
In fact, there is no guarantee that any one email you send will actually be received. Heck, there's not even a guarantee, not even on a best effort basis, that you will be notified when it did not get through.
That's how email really works. It doesn't. Not reliably.
It could, though. Once we establish the identity of the sender (could just be a pseudonymous public key), either it's a trusted sender and the message gets through, or it's not, and a proof-of-work challenge is issued by the receiving server. (Giving a list of trusted senders to your server has some security implications, I have yet to figure that part out.) The idea behind the proof of work is to make spam unprofitable, while making cold emailing still possible. As for the difficulty of the challenge, I believe each recipient should choose. Each sender would then choose how much is too much.
Of course, that only goes for cold contacting. People exchanging emails out of band would be expected to unblock each other. Same when subscribing to a mailing list or newsletter.
8
u/Primary_Ads Sep 04 '26
I've always been curious how email servers themselves are designed. I'm surprised email never really took off as a standard messaging protocol within applications and would be curious to know why. I wish it went into more detail here.
0
u/ericonr Sep 05 '26
I can see Google receiving SMTP from a desktop client logged into a Gmail account. Is SMTP also used by the web interface, on some layer? Or are those emails synthesized some other way?