Email runs on three protocols: SMTP sends and delivers mail, and IMAP or POP3 let a mail client read it. If you are setting up a mail server, choosing ports for a mail client, or working out why mail will not send from a server, this guide explains what each protocol does, which ports it uses, and how they fit together.
SMTP: Sending and Delivering
SMTP (Simple Mail Transfer Protocol) moves mail. It is used twice for every message: once when your mail client hands the message to your own mail server (submission), and again when your server delivers it to the recipient’s server (relay or delivery).
| Port | Used for | Encryption |
|---|---|---|
| 25 | Server-to-server delivery | STARTTLS when both sides support it |
| 587 | Submission from a mail client or app, with login | STARTTLS |
| 465 | Submission from a mail client or app, with login | TLS from the first byte |
Port 25 is the one that gets blocked. Most large cloud providers block outbound port 25 by default to limit spam, which stops a server from delivering mail directly even though everything else works. If you run your own mail server, you need a host that leaves it open. VPS For Life plans have outbound Port 25 open by default; more background in What Is Port 25?
IMAP: Reading Mail on Several Devices
IMAP (Internet Message Access Protocol) keeps messages on the server and synchronises them. Read a message on your phone and it shows as read on your laptop; move it to a folder and every device sees the move.
| Port | Encryption |
|---|---|
| 993 | TLS — use this |
| 143 | Unencrypted or STARTTLS — avoid for logins |
POP3: Downloading to One Device
POP3 (Post Office Protocol) downloads messages to one device and usually removes them from the server. There is no folder sync between devices.
| Port | Encryption |
|---|---|
| 995 | TLS — use this |
| 110 | Unencrypted or STARTTLS — avoid for logins |
Side by Side
| SMTP | IMAP | POP3 | |
|---|---|---|---|
| Job | Send and deliver | Read and sync | Download |
| Mail stays on server | — | Yes | Usually no |
| Works across devices | — | Yes | No |
| Secure port | 587 or 465 (clients), 25 (servers) | 993 | 995 |
How One Email Travels
- Your mail client submits the message to your mail server over SMTP on port 587 or 465, logging in as it does.
- Your server looks up the recipient domain’s MX record and delivers the message to that server over SMTP on port 25.
- The recipient’s server checks it — reverse DNS, SPF, DKIM, DMARC, reputation — and files it.
- The recipient reads it with IMAP (synced) or POP3 (downloaded).
Only step 2 needs port 25 open outbound on your server. If you send through a relay such as Amazon SES instead, your server only ever uses 587 or 465 and the relay does step 2 — the trade-offs are in VPS vs SMTP relay.
What a Self-Hosted Mail Server Needs
- An MTA for SMTP, usually Postfix — see How to Install and Configure Postfix.
- An IMAP/POP3 server, usually Dovecot — see How to Install and Configure Dovecot.
- A dedicated IP with reverse DNS matching the server’s hostname — see rDNS VPS.
- SPF, DKIM and DMARC records for the domain — check them with the email authentication checker.
Which Should I Use for Reading Mail?
IMAP, in almost every case: it keeps phone, webmail and desktop in step. POP3 still suits a single device that should hold the only copy, or an archive that pulls mail off the server.
Common Problems
Mail sends from the client but never arrives — the server accepted it on 587 but cannot deliver on port 25. Check the mail log for connection timeouts to remote port 25, and whether your host blocks it.
“Relay access denied” — the client is submitting without logging in, or on port 25 instead of 587.
Delivered to spam — usually missing reverse DNS, SPF or DKIM, or a listed IP. See How to Check and Remove Your IP from Email Blacklists.
FAQ
Does SMTP receive mail?
Yes, between servers: your server receives incoming mail from other servers over SMTP on port 25. What SMTP does not do is let a person read their mailbox — that is IMAP or POP3.
Should I always use the encrypted ports?
Yes for anything with a login: 587 or 465 for sending, 993 for IMAP, 995 for POP3. Port 25 between servers uses STARTTLS where the other side supports it.
Can I send without opening port 25?
Yes, through a relay that accepts your mail on 587 or 465 and delivers it for you.
Continue Reading
- How to Set Up a Complete Mail Server (Postfix + Dovecot + SPF/DKIM/DMARC)
- Best Email Marketing Software for a VPS
- SMTP VPS
Browse more articles in Email Hosting & Deliverability.