Report this

What is the reason for this report?

Port 25 won't open despite ufw allow 25

Posted on January 29, 2021

I’m trying to set up an email server. I can’t seem to get port 25 to open for me. I literally just did:

ufw disable

ufw reset

ufw default deny incoming

ufw default allow outgoing

sudo ufw allow 22/tcp

sudo ufw allow 25

And then sudo ufw status verbose

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere                  
25                         ALLOW IN    Anywhere                  
22/tcp (v6)                ALLOW IN    Anywhere (v6)             
25 (v6)                    ALLOW IN    Anywhere (v6)   

However, one cursory glance of sudo netstat -tulpn | grep LISTEN and…

tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      512/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      664/sshd: /usr/sbin 
tcp6       0      0 :::22                   :::*                    LISTEN      664/sshd: /usr/sbin 

and telnet [my server IP] 25:

telnet: Unable to connect to remote host: Connection refused

What gives? How can I open up my ports?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

My guess is Postfix isn’t configured or running. Disable UFW and see if Postfix starts working. If it doesn’t, it’s probably not configured correctly or the service isn’t running. I doubt it is a UFW problem.

Hello all,

It is possible that port 25 is closed for new accounts. This is something DigitalOcean has been doing to reduce spam on the network.

To qualify for the ability to send out emails, new accounts are required to wait 60 days before a request for removing the restriction could be raised. Once your account has reached 60 days of stable use, you could reach out to the DigitalOcean support team so they could look into this for you:

https://www.digitalocean.com/support/

In the meantime, you could instead use ports 465 or 587.

Hope that helps! Regards, Alex

Hi there,

SMTP port 25 is blocked on all Droplets for new accounts to prevent spam and other abuses of our platform.

Even if SMTP were available, DigitalOcean strongly recommends against running your own mail server in favor of using a dedicated email deliverability platform. Dedicated email deliverability platforms are better at handling deliverability factors like IP reputation.

To send mail from DigitalOcean, they recommend using SendGrid.

You could also use port 587 or 465 instead.

Source: https://docs.digitalocean.com/support/why-is-smtp-blocked/

- Bobby.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.