#TIL : How SMTP works

When a email send through an SMTP (with authentication), every SMTP server is a hop in mail routing. So it will transfer to localmail or forward the email to next hop (shortest distance via DNS MX record).

And standard port of SMTP is 25 (unsecured, but can upgrade to TLS via STARTTLS command).

1
2
3
4
5
6
7
8
9
10
11
12
$ nslookup -type=mx gmail.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
gmail.com mail exchanger = 20 alt2.gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 5 gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 30 alt3.gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 10 alt1.gmail-smtp-in.l.google.com.
gmail.com mail exchanger = 40 alt4.gmail-smtp-in.l.google.com.

Authoritative answers can be found from:

So shortest SMTP of gmail.com domain is gmail-smtp-in.l.google.com

1
$ telnet gmail-smtp-in.l.google.com 25

SMTPor : Dead simple SMTP testing tool

Never need a bigass mail client to test your SMTP config !

Github Repo : https://github.com/khanhicetea/smtpor

Demo

SMTPor

TL;DR

Using Docker to run

1
$ docker run -d -p 3000:3000 khanhicetea/smtpor

Then open http://localhost:3000 to try a shot !

Install & Start

1
2
$ npm install
$ npm start

Heroku Deploying

1
2
3
$ heroku login
$ heroku git:remote -a [your-app-name]
$ git push heroku master

Contributors

  • @khanhicetea

License

MIT License