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
Outgoing port 25 blocking prevents spam from new servers. This is standard hosting provider practice.
telnet gmail-smtp-in.l.google.com 25
If the connection hangs or fails, outgoing port 25 is blocked.
ss -tlnp | grep :25
Open a support ticket with:
Before requesting unblock, configure:
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
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.