How to make this postfix port 25 accessible from outside?

Linode Staff

How to make this postfix port 25 accessible from outside so that I can add it in gmail email accounts?

When I do this:

telnet mail.example.in 25

it gives:

Trying ::::::aaaa…
Trying 192.168.1.11…
telnet: Unable to connect to remote host: No route to host


from within this server: 192.168.1.11
telnet localhost 25 works

It is working with my other Linode but not with this.

1 Reply

Hey there,

This is usually caused by a firewall problem. If you need to open up port 25 you need to run the following command:

 iptables -A INPUT -p tcp --dport 25 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

After you enter this command make sure to set them to persistent.

I prefer to us Uncomplicated Firewall (UFW) once you install it, all you have to do is run the following command:

 sudo ufw allow 25

UFW automatically sets the rules to persistent. Also with UFW you can use the service name instead of port number. If you want to open port 25 for smtp you can just enter:

 sudo ufw allow smtp

Lastly, you will want to follow our guide explaining how to configure Postfix to Send Mail Using Gmail and Google Apps

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