0

I just set up Postfix + Dovecot on Ubuntu and it doesn't seem to behave 100% as expected. If I run telnet localhost 25, I get:

Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 playground ESMTP Postfix (Ubuntu)

This is good. If I try connecting to port 25 via telnet using Putty, however, I don't receive any greeting or response. It does connect, but just hangs there.

I can send from Gmail to my server and receive the mail, and I can email Gmail back, so it's partially configured. But I'm having trouble with another email service delivering to my domain, so I'm trying to debug if this is related.

One thing to note: I did netstat -antup|grep 25 and I get:

tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      25774/dovecot
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      25774/dovecot
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      25774/dovecot
tcp6       0      0 :::993                  :::*                    LISTEN      25774/dovecot
tcp6       0      0 :::995                  :::*                    LISTEN      25774/dovecot
tcp6       0      0 :::143                  :::*                    LISTEN      25774/dovecot

And if I do netstat -antup|grep master (postfix):

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      14939/master
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      14939/master
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      14939/master
tcp6       0      0 :::25                   :::*                    LISTEN      14939/master
tcp6       0      0 :::587                  :::*                    LISTEN      14939/master
tcp6       0      0 :::465                  :::*                    LISTEN      14939/master

Shouldn't these be tied to an IP address instead of localhost? (I'm surprised my mail works at all)

Update: My firewall info:

5038/udp                   ALLOW       127.0.0.1
5038                       ALLOW       127.0.0.1
443                        ALLOW       Anywhere
8080                       ALLOW       Anywhere
7500                       ALLOW       Anywhere
7474                       ALLOW       Anywhere
25                         ALLOW       Anywhere
22                         ALLOW       Anywhere
25/tcp                     ALLOW       Anywhere
21/tcp                     ALLOW       Anywhere
465                        ALLOW       Anywhere
587                        ALLOW       Anywhere
110                        ALLOW       Anywhere
995                        ALLOW       Anywhere
143                        ALLOW       Anywhere
993                        ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
443 (v6)                   ALLOW       Anywhere (v6)
8080 (v6)                  ALLOW       Anywhere (v6)
7500 (v6)                  ALLOW       Anywhere (v6)
7474 (v6)                  ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
25/tcp (v6)                ALLOW       Anywhere (v6)
21/tcp (v6)                ALLOW       Anywhere (v6)
465 (v6)                   ALLOW       Anywhere (v6)
587 (v6)                   ALLOW       Anywhere (v6)
110 (v6)                   ALLOW       Anywhere (v6)
995 (v6)                   ALLOW       Anywhere (v6)
143 (v6)                   ALLOW       Anywhere (v6)
993 (v6)                   ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
25 (v6)                    ALLOW       Anywhere (v6)
6
  • 2
    0.0.0.0 means it's listening on all interfaces. 127.0.0.1 would mean it's listening only on localhost.
    – joeqwerty
    Jun 5, 2015 at 15:48
  • 2
    0.0.0.0:25 means it listens on all addresses on all interfaces. 127.0.0.1:25 would be localhost only. Jun 5, 2015 at 15:48
  • Ok, that makes sense. Still not sure why port 25 only responds via localhost and note remotely, though. I can connect from my laptop's Putty to port 25, but it doesn't greet me or accept commands.
    – Anthony
    Jun 5, 2015 at 15:51
  • 3
    Is Port 25 blocked by your firewall or your ISP?
    – sebix
    Jun 5, 2015 at 16:37
  • I did "ufw status" and updated my answer with the details. Perhaps it is blocked at the hosting level, but I can't imagine it would be. (linode.com) Note: I also tried connecting to 587 - I can talk to Postfix via "telnet localhost 587", but not from Putty remotely. It connects, but there is no greeting or responses.
    – Anthony
    Jun 5, 2015 at 17:02

3 Answers 3

1

May be your firewall. Please execute the following command and try again:

iptables -I INPUT -p tcp --dport 25 -j ACCEPT
1

Check with network administrator whether there is any restriction in networks a firewall may be might be deployed in between user and server and specific port is blocked in server...

0

If you can recieve emails from gmail, then your firewall is ok and postfx are working. You need to explore maillog to find out what happening with emails you sent from problem domain. Typically its located in:

/var/log/maillog

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .