Here is the thing, my server fails to connect to gmail SMTP with timeout error. I think the 465 port is closed on my server so I did couple of thing, now my csf.config
file hase this two lines:
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2011,2222,8080"
TCP_OUT = "20,21,22,25,53,80,110,113,443,2011,2222,8080,465"
and I searched the iptable file for 465
and there is three occurance like so:
-A INPUT -p tcp -m tcp --dport 465 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 465 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 465 -j ACCEPT
when I run netstat -tulpn
command I get this result:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 158.58.184.42:53 0.0.0.0:* LISTEN 1938/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1938/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1552/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1681/exim
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 9671/httpd
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1505/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1505/dovecot
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1689/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1681/exim
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1505/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1505/dovecot
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9671/httpd
tcp 0 0 :::21 :::* LISTEN 1817/proftpd
tcp 0 0 :::22 :::* LISTEN 1552/sshd
tcp 0 0 :::25 :::* LISTEN 1681/exim
tcp 0 0 :::587 :::* LISTEN 1681/exim
tcp 0 0 :::2222 :::* LISTEN 1675/directadmin
udp 0 0 158.58.184.42:53 0.0.0.0:* 1938/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 1938/named
The server ip is : 158.58.184.42 and smtps port (465) is not open yet! What should I do?
fsockopen
function gives errorunable to connect to smtp.gmail.com:465 (Connection timed out)