I have an Ubuntu 14.04 (Trusty Tahr) is mounted on AWS and i cannot connect to the SMTP GMail service vía:
SSL(465):
## $ telnet smtp.gmail.com 465 ##
Trying 74.125.28.109...
Trying 74.125.28.108...
Trying 2607:f8b0:400e:c04::6c...
telnet: Unable to connect to remote host: Network is unreachable
TLS(587):
## $ telnet smtp.gmail.com 587 ##
Trying 74.125.28.108...
Trying 74.125.28.109...
Trying 2607:f8b0:400e:c04::6c...
telnet: Unable to connect to remote host: Network is unreachable
My open ports are:
## $ sudo netstat -tlnp ##
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1069/mysqld
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1050/redis-server 1
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 959/sshd
tcp6 0 0 :::80 :::* LISTEN 7716/apache2
tcp6 0 0 :::22 :::* LISTEN 959/sshd
The UFW Firewall are inactive
## $ sudo ufw status verbose ##
Status: inactive
I already saved the firewall rules with:
$ sudo iptables -A INPUT -p tcp --dport 587 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
$ sudo iptables -A OUTPUT -p tcp --sport 587 -m conntrack --ctstate ESTABLISHED -j ACCEPT
$ sudo iptables-save