SMTP with Postfix only works internally.
So my first thought was the firewall. Here's iptables -L:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere 127.0.0.0/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:imap2
ACCEPT tcp -- anywhere anywhere tcp dpt:585
ACCEPT tcp -- anywhere anywhere tcp dpt:imaps
ACCEPT tcp -- anywhere anywhere tcp dpt:2025
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere tcp dpt:ssmtp
ACCEPT tcp -- anywhere anywhere tcp dpt:submission
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere icmp echo-request
LOG all -- anywhere anywhere limit: avg 5/min burst 5 LOG level debug prefix `iptables denied: '
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Any obvious mistakes?
And here's the output of netstat -lntp:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 10153/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 10153/dovecot
tcp 0 0 127.0.0.1:44069 0.0.0.0:* LISTEN 23261/current
tcp 0 0 127.0.0.1:54470 0.0.0.0:* LISTEN 27868/current
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 6765/mysqld
tcp 0 0 127.0.0.1:40718 0.0.0.0:* LISTEN 18128/current
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 10153/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 10153/dovecot
tcp 0 0 127.0.0.1:39154 0.0.0.0:* LISTEN 19565/current
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2084/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 16962/master
tcp6 0 0 :::80 :::* LISTEN 14926/apache2
tcp6 0 0 :::22 :::* LISTEN 2084/sshd
So it looks like something is listening on port 25, right?
Thanks for any help you can offer.
5 Replies
telnet waffles.ovrmnd.com 25
Trying 50.116.39.110...
telnet: connect to address 50.116.39.110: Operation timed out
telnet: Unable to connect to remote host
Locally, it's fine and dandy:
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 waffles.ovrmnd.com ESMTP Postfix (Ubuntu)
ehlo localhost
250-waffles.ovrmnd.com
250-PIPELINING
250-SIZE 30720000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
% telnet waffles.ovrmnd.com 25
Trying 50.116.39.110...
Connected to waffles.ovrmnd.com.
Escape character is '^]'.
220 waffles.ovrmnd.com ESMTP Postfix (Ubuntu)
For future reference, I got it to work by adding these lines to /etc/postfix/master.cf:
465 inet n - n - - smtpd
587 inet n - n - - smtpd
2025 inet n - n - - smtpd
Which tells postfix to listen to those ports, too.
So now I can connect! (But I'm getting a new set of errors regarding authentication. Which I will save for another post.)
Thanks!