Common Issues

Emails Not Sent

Why emails from server end up in spam or don't arrive, and how to fix it

Email delivery problems from a VPS are very common. Here are the most frequent causes and how to resolve them.


Port 25 blocked

The most common cause. Port 25 (SMTP) is blocked by default on VPS to prevent spam. This block is at the network level, not the server's firewall.

How to verify:

telnet smtp.gmail.com 25
# If it times out, port is blocked

Solution: Use port 587 (submission) or 465 (SMTPS) instead of 25 to send emails through an external SMTP relay.

If you need to unblock port 25 for a dedicated mail server, contact support with a valid reason. The unblock is evaluated case by case.


Emails end up in SPAM

Most common causes:

1. IP in blacklist

Check if your IP is blacklisted:

If you're blacklisted, follow the delisting procedure specific to each list.

2. Reverse DNS not configured

Many mail servers reject emails if the PTR record is not configured. See: Reverse DNS

Verify:

host SERVER_IP
# Must respond with a hostname, not "does not exist"

3. SPF not configured

Add an SPF record in your domain's DNS to authorize your IP to send emails:

TXT @ "v=spf1 ip4:SERVER_IP ~all"

Or if you use a relay:

TXT @ "v=spf1 include:_spf.relay-example.com ~all"

4. DKIM not configured

DKIM adds a digital signature to emails. If not configured, emails are more likely to end up in spam.

5. DMARC not configured

Add a DMARC record in your DNS:

TXT _dmarc "v=DMARC1; p=none; rua=mailto:postmaster@example.com"

Complete email configuration test

Use mail-tester.com:

  1. Go to the site and get a temporary email address
  2. Send a test email to that address
  3. Return to the site and see the score and issues detected

To send reliable emails from a web application, it's recommended to use an external SMTP relay like:

  • SendGrid: 100 emails/day free
  • Mailgun: 1000 emails/month free
  • Amazon SES: very economical
  • Brevo (ex Sendinblue): 300 emails/day free
  • Postmark: excellent deliverability

These services manage IP reputation and guarantee deliverability. Just use SMTP credentials in your CMS or application.


Postfix configuration with SMTP relay

If you use Postfix as mail server:

nano /etc/postfix/main.cf

Add:

relayhost = [smtp.sendgrid.net]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
nano /etc/postfix/sasl_passwd
[smtp.sendgrid.net]:587 apikey:YOUR_API_KEY
postmap /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
systemctl restart postfix

WordPress doesn't send emails

WordPress uses PHP mail() function which often doesn't work on VPS. Install an SMTP plugin:

  1. Install WP Mail SMTP or FluentSMTP plugin
  2. Configure it with your external SMTP relay credentials
  3. Test sending from the plugin page

On this page