익명 22:14

Can't connect to smtp.gmail.com on port 465 or 587

Can't connect to smtp.gmail.com on port 465 or 587

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


Top Answer/Comment:

I had similar problem, VPS machine without firewall and with same error as you listed. I contacted support of VPS provider and it turned out they had one more firewall that was wrapping my machine. So they enabled port 587 on that firewall and everything was working smoothly.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다