Outgoing connections on port 25 are blocked on every VPS, which keeps our addresses off spam blocklists. Send email through your email provider or a transactional email service instead, on port 587 (STARTTLS) or 465 (TLS). Receiving email on port 25 is not affected, and dedicated servers are not blocked at all.
What Is Blocked
- Blocked: connections from your server to other mail servers on port 25, which is how a server delivers email directly.
- Not blocked: ports 587 and 465 to a mail provider, and incoming connections to your server on port 25.
Sending From an App or Website
Most software has SMTP settings. Use your provider's details:
| Setting | Typical value |
|---|---|
| Host | Your provider's SMTP host |
| Port | 587 with STARTTLS, or 465 with TLS |
| User name and password | From your provider; often an app password or API key |
WordPress, n8n, Nextcloud, Uptime Kuma and most other apps take these settings directly.
Relaying With Postfix
To keep local tools such as mail and cron working, relay Postfix through your provider:
postconf -e 'relayhost = [smtp.example.com]:587'
postconf -e 'smtp_sasl_auth_enable = yes'
postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'
postconf -e 'smtp_sasl_security_options = noanonymous'
postconf -e 'smtp_tls_security_level = encrypt'
echo '[smtp.example.com]:587 USER:PASSWORD' > /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd && postmap /etc/postfix/sasl_passwd
systemctl restart postfix
Replace the host, user and password with your provider's.
Testing
nc -vz smtp.example.com 587 # should connect
nc -vz smtp.example.com 25 # times out: port 25 is blocked
Running Your Own Mail Server
You can host a mail server on a VPS that receives email, but it must send through a relay on port 587 or 465. A dedicated server can deliver email directly on port 25; set reverse DNS for its address first and keep it off spam blocklists, or the server can lose that. If you need reverse DNS for its address, open a support ticket; see Your Server's IP Addresses.