25 port on my dproplet blocked ?

November 1, 2019 77 views
DigitalOcean Accounts

I can not send and receive letters from my server, what is the problem?

droplet: lemp-s-1vcpu-1gb-fra1-01
ip: 165.22.90.227

1 Answer

Hi @deloest,

I’ve just scanned your open ports and it seems like, you have the following open

PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
1500/tcp open  vlsi-lm

The above state, you don’t have any mailing ports enabled. To confirm this, you can ssh to your droplet

ssh root@IPOfYourDroplet

and type in

netstat -tulpen

It will show you all ports currently being used by a service. If you see the following ports - 25,110,143,465,587,993,995 then you have a Mailing service installed and you just need to open your ports to receive incoming and outgoing traffic.

In the example below, I’ll show you how to open traffic for port 25 but you have do it for every other one using the same command. You’ll just need to change your port

sudo iptables -A INPUT -p tcp -m multiport --dports 25 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp -m multiport --dports 25 -m conntrack --ctstate ESTABLISHED -j ACCEPT

This should enable access for incoming connections to your droplet so that you can receive e-mails sent to you. Now, if you wish to learn more about Iptables, DigitalOcean have a very good article about it - HERE

No Mailing service installed

It’s possible you don’t have a mailing service installed thus not being able to send or receive messages. This can again be confirmed using the command

netstat -tulpen

If nothing is actually listening to the ports 25,110,143,465,587,993,995 then you don’t have a mailing service.

If that’s the case, you can configure one - Postfix by checking out this article, it’s again written by DigitalOcean so it will be perfect for your droplet - HERE

Let me know if you need further assistance,

Regards,
KDSys

by Mitchell Anicas
Iptables is the software firewall that is included with most Linux distributions by default. This cheat sheet-style guide provides a quick reference to iptables commands that will create firewall rules are useful in common, everyday scenarios. This includes iptables examples of allowing and blocking various services by port, network interface, and source IP address.
Have another answer? Share your knowledge.