Incoming SMTP mail and iptables firewall

I have setup postfix on my linode.

Do I need to open port 25 for incoming with something liike:

iptables -A INPUT -p tcp –dport 25 -j ACCEPT

…and if I do are there any risks other than the possibility of receiving some spam?

3 Replies

It would depend on how you've setup postfix. What are you doing with postfix exactly? It is a "send only" system, or do you actually want to be able to receive emails?

If its a send only system, then there is no reason why you should open port 25 to the public, better to keep it closed.

In my case, I use CentOS 7, which uses firewalld/systemd, so I am not sure about the iptables command.

@patrick_here:

I have setup postfix on my linode.

Do I need to open port 25 for incoming with something liike:

iptables -A INPUT -p tcp –dport 25 -j ACCEPT

…and if I do are there any risks other than the possibility of receiving some spam?
It could be even worse: You could receive real email (non-spam) that you have to handle. :D

Do you really want to receive email at the yourusername@yourmachine address?

Enabling postfix and allowing port 25 automatically makes such address to be reachable.

It won't make any emails reachable automatically, unless he has setup postfix properly.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct