Port 25 and sending mail from the server

12.03.2026
Complexity
min.

Summary

Port 25 (SMTP) may be blocked by default on the server as an anti-spam measure. To send mail from the server, configure a mail server and request port unblocking if needed.

Applies to:
✔ VPS
✔ Dedicated servers

Why port 25 is blocked

Outgoing port 25 blocking prevents spam from new servers. This is standard hosting provider practice.

Check port 25 availability

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

If the connection hangs or fails, outgoing port 25 is blocked.

ss -tlnp | grep :25

How to request unblocking

Open a support ticket with:

  • Server IP address
  • Purpose (own mail server, sending notifications)
  • Domain from which email will be sent

Preparation before sending mail

Before requesting unblock, configure:

  1. PTR record for the IP (request via support)
  2. SPF record in DNS
  3. DKIM signature
  4. DMARC record

Alternative: sending via SMTP relay

If port 25 is blocked and unblocking is not needed, use an external SMTP service (port 587 or 465). Configure Postfix as a relay:

relayhost = [smtp.provider.com]: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
systemctl restart postfix

Verification

telnet gmail-smtp-in.l.google.com 25
echo "Test" | mail -s "Test" your@email.com
Port 25 unblocking may take up to 24 hours. If the port is still unavailable after unblocking, open a follow-up support ticket.
Was this information helpful?
Yes   No
 
By continuing to use this website you will be agreeing to the website Acceptable Use Policy and the Use of Cookies while using the website and our services. Please also read our Privacy Policy under which, to the extent stated, you consent to the processing of your personal data.