I need to send email notifications to my subscribers, but I can’t do it because of the timeout error.
Please i need to know if it is possible to open port 25 and send emails?

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.

×
Submit an Answer
2 answers

Hi @redouanadmer,

Firstly, please make sure you a Mail Service which can send mails. If you are uncertain which one, I’ll recommend using Postfix. DigitalOcean have a pretty good tutorial on the installation and configuration of said Postfix. You can view it here - https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-16-04

Now onto the port. If you are using ufw, to open port 25 you can use the following command

sudo ufw allow 25/tcp

If you are using Iptables, you can use the bellow

iptables -I INPUT -p tcp -m tcp --dport 25 -j ACCEPT

Regards,
KDSys

by finid
Postfix is a *mail transfer agent* (MTA), an application used to send and receive email. In this tutorial, we will install and configure Postfix so that it can be used to send emails by local applications only — that is, those installed on the same server that Postfix is installed on.
  • It’s not about how to setup Postfix. The OP is facing a problem many of us are facing where DigitalOcean blocks ports like 25, 465 and 587 to be used in Droplets account-wide.

Hello all,

It is possible that port 25 is closed for new accounts. This is something we have been doing to reduce spam on our network. Please do not think that we are accusing you of sending spam, it is more that we simply cannot accurately determine who is going to send it.

Stopping spam is a constant fight, so we have implemented some restrictions on newer accounts. To qualify for the ability to send out email, we do require accounts to wait 60 days before we can look into removing the restriction. Once your account has reached 60 days of stable use, please do reach back out to us so we can look into this for you.

Hope that helps!
Regards,
Alex

  • How can I tell if port 25 is closed and who can I contact to have it opened please?
    thank you

    • Hello there,

      You can test if the port is open using telnet for example:

      telnet DropletIPaddress 25
      

      Where you need to change DropletIPaddress with the IP address of your droplet.

      If the port is blocked you will get a message like
      telnet: Unable to connect to remote host: Connection refused

      You can also reach out to our amazing support team using the link bellow:

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

      Hope that helps!
      Alex

      • What if the telnet command works properly?

        But nmap -p 25,465,587 DropletIPaddress returns:

        Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-17 21:47 CEST
        Nmap scan report for DropletName (DropletIPaddress)
        Host is up (0.000088s latency).
        
        PORT    STATE  SERVICE
        25/tcp  closed smtp
        465/tcp closed smtps
        587/tcp closed submission
        
        Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
        
        • Hello, @RvH

          You can then try to send an email on port 25. If this does not work you can reach out to our support team.

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

          Regards,
          Alex

      • The problem I faced is that droplet should have some service running on port 25. I know, it’s pretty straightforward, but I somehow missed that and was getting exactly the same message. First of all, it should be:

        telnet localhost 25
        

        on a droplet, and if this passes, then:

        telnet DropletIPaddress 25
        

        I hope this can save some time.

        • Hello there,

          I’ll still recommend sending emails using ports 465 or 587 instead of 25. There are mail providers that will flag messages as SPAM if they’re not sent using authentication and via port 25.

          Regards,
          Alex