I have a google compute cloud VM (Ubuntu 17.10) and I am trying to setup a mail daemon. I have installed postfix and dovecot according to this article (all steps followed exactly, from a fresh install). Running sudo netstat -tuplen
yields:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN 102 15523 829/systemd-resolve
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 0 142345 6971/spamd.pid --cr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 24342 2190/sshd
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 0 122740 31644/dovecot
tcp6 0 0 :::5355 :::* LISTEN 102 15526 829/systemd-resolve
tcp6 0 0 ::1:783 :::* LISTEN 0 142343 6971/spamd.pid --cr
tcp6 0 0 :::80 :::* LISTEN 0 44991 13243/apache2
tcp6 0 0 :::22 :::* LISTEN 0 24351 2190/sshd
tcp6 0 0 :::443 :::* LISTEN 0 58960 13243/apache2
tcp6 0 0 :::993 :::* LISTEN 0 122741 31644/dovecot
udp 0 0 0.0.0.0:5355 0.0.0.0:* 102 15522 829/systemd-resolve
udp 0 0 127.0.0.53:53 0.0.0.0:* 102 15530 829/systemd-resolve
udp 0 0 10.152.0.4:68 0.0.0.0:* 101 96631 599/systemd-network
udp 0 0 10.152.0.4:123 0.0.0.0:* 0 96928 27031/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 0 96926 27031/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 0 96922 27031/ntpd
udp6 0 0 :::5355 :::* 102 15525 829/systemd-resolve
udp6 0 0 fe80::4001:aff:fe98:123 :::* 0 96932 27031/ntpd
udp6 0 0 ::1:123 :::* 0 96930 27031/ntpd
udp6 0 0 :::123 :::* 0 96919 27031/ntpd
Which means the service is active and listening for incoming connections. My firewall status:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp (OpenSSH) ALLOW IN Anywhere
80,443/tcp (Apache Full) ALLOW IN Anywhere
25/tcp (Postfix) ALLOW IN Anywhere
993 DENY IN Anywhere
587 DENY IN Anywhere
143/tcp (Dovecot IMAP) ALLOW IN Anywhere
993/tcp (Dovecot Secure IMAP) ALLOW IN Anywhere
465/tcp (Postfix SMTPS) ALLOW IN Anywhere
587/tcp (Postfix Submission) ALLOW IN Anywhere
22/tcp (OpenSSH (v6)) ALLOW IN Anywhere (v6)
80,443/tcp (Apache Full (v6)) ALLOW IN Anywhere (v6)
25/tcp (Postfix (v6)) ALLOW IN Anywhere (v6)
993 (v6) DENY IN Anywhere (v6)
587 (v6) DENY IN Anywhere (v6)
143/tcp (Dovecot IMAP (v6)) ALLOW IN Anywhere (v6)
993/tcp (Dovecot Secure IMAP (v6)) ALLOW IN Anywhere (v6)
465/tcp (Postfix SMTPS (v6)) ALLOW IN Anywhere (v6)
587/tcp (Postfix Submission (v6)) ALLOW IN Anywhere (v6)
And in the firewall rules of google cloud platform:
So it seems as everything is ok, telnet localhost 993
returns
Trying 127.0.0.1...
Connected to localhost
Escape character is '^]'.
Connection closed by foreign host.
(The connection closes immediately)
When I try telnet <ipaddress> 993
from a remote host, it returns
Trying <ipaddress>...
telnet: Unable to connect to remote host: Connection timed out
What am I doing wrong?