Emails Not Sent

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

02

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:

bash
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.

03

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:

bash
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"
  • MXToolbox Blacklist Check
  • MultiRBL
04

Complete email configuration test

Use mail-tester.com:

  • Go to the site and get a temporary email address
  • Send a test email to that address
  • Return to the site and see the score and issues detected
05

Use external SMTP relay (recommended solution)

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

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

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

Postfix configuration with SMTP relay

If you use Postfix as mail server:

bash
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
bash
nano /etc/postfix/sasl_passwd
[smtp.sendgrid.net]:587 apikey:YOUR_API_KEY
bash
postmap /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
systemctl restart postfix
07

WordPress doesn't send emails

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

  • Install WP Mail SMTP or FluentSMTP plugin
  • Configure it with your external SMTP relay credentials
  • Test sending from the plugin page

DeluxHost, founded in 2023, offers high-quality hosting solutions for various digital needs. We provide shared hosting, VPS, and dedicated servers with advanced security and global data centers.

© DeluxHost, All rights reserved. | VAT Number : IT17734661006
All Systems Operational