4

I am running Debian Jessie 8.1. The VPS provider says that port 25 is open. However, when I installed Rainloop and am not able to use it with the System users.

Under the RainLoop admin panel I went to Domains, and added: localhost, 127.0.0.1, 123.123.123.123 (as my server's IP address), and example.com (as my main domain).

All of the 4 domains have the same settings: IMAP/SMTP server name has the localhost/127.0.0.1/123.123.123.123/example.com. And IMAP has port 143 and SMTP port 25. But when I click on the Test button - the localhost and 127.0.0.1 domains are both passing IMAP and SMTP. But the 123.123.123.123 andexample.com the IMAP passes, and the SMTP fails with:

stream_socket_client(): unable to connect oto tcp:123.123.123.123:25 (connection refused)

When I try to login using root or info as server users, and their server password, I get Authentication Failed.

Fron putty, I type iptables -L and

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
fail2ban-postfix-sasl  tcp  --  anywhere             anywhere             multiport dports smtp
fail2ban-pureftpd  tcp  --  anywhere             anywhere             multiport dports ftp
fail2ban-dovecot-pop3imap  tcp  --  anywhere             anywhere             multiport dports pop3,pop3s,imap2,imaps
fail2ban-ssh  tcp  --  anywhere             anywhere             multiport dports ssh

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain fail2ban-dovecot-pop3imap (1 references)
target     prot opt source               destination
REJECT     all  --  123.123.123.123.vultr.com  anywhere             reject-with icmp-port-unreachable
RETURN     all  --  anywhere             anywhere

Chain fail2ban-postfix-sasl (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain fail2ban-pureftpd (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain fail2ban-ssh (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

update The output of sudo netstat -tnlp is:

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:110             0.0.0.0:*               LISTEN      502/dovecot
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      1/init
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      490/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      981/exim4
tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      571/tor
tcp        0      0 127.0.0.1:9051          0.0.0.0:*               LISTEN      571/tor
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      1/init
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      502/dovecot
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      540/mysqld
tcp        0      0 0.0.0.0:106             0.0.0.0:*               LISTEN      493/inetd
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      488/memcached
tcp6       0      0 :::110                  :::*                    LISTEN      502/dovecot
tcp6       0      0 :::143                  :::*                    LISTEN      1/init
tcp6       0      0 :::8080                 :::*                    LISTEN      622/apache2
tcp6       0      0 :::80                   :::*                    LISTEN      622/apache2
tcp6       0      0 :::8081                 :::*                    LISTEN      622/apache2
tcp6       0      0 :::21                   :::*                    LISTEN      538/vsftpd
tcp6       0      0 :::22                   :::*                    LISTEN      490/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      981/exim4
tcp6       0      0 :::443                  :::*                    LISTEN      622/apache2
tcp6       0      0 :::993                  :::*                    LISTEN      1/init
tcp6       0      0 :::995                  :::*                    LISTEN      502/dovecot

I do not know how to read the above output, is it blocking port 25? Or is the issue with something else?

  • 1
    I don't think so. Port 25 (named smtp in the output) is matched by the rule fail2ban-postfix-sasl, which just returns, so that port is left as-is. Do you have anything listening on 25? What's the output of sudo netstat -tnlp? – muru Dec 31 '15 at 20:52
  • I have updated the question with the results of netstat. exim4 is listening on 25 – KingsInnerSoul Dec 31 '15 at 23:17
  • 1
    exim is listening on 25 only for localhost (127.0.0.1, ::1). You should configure it to listen on all IPs, or at least on whatever your external IP is. – muru Dec 31 '15 at 23:18
  • 1
    I don't use exim myself, so I'm not sure. The Debian wiki page on exim says you can run dpkg-reconfigure exim4-config, which should ask you which IPs to listen on. – muru Dec 31 '15 at 23:45
  • 1
    Seconding @muru's diagnosis and recommendation. You need to reconfigure exim4 (as instructed in the previous comment) and remove all values to the question "IP-addresses to listen on for incoming SMTP connections". – roaima Jan 3 '16 at 1:10
0

Honestly, I have no idea what was the issue. I had to remove and purge all related packages. It is important to purge because remove only removes the files, but not the configuration files, therefore, the folder structure will stay behind with any conf files. The purge command removes the files and the configuration files. I have learned that from Bencane.com.

I first ran dpkg-query -l *postfix* to see all related packages. Then I removed it all by apt-get remove *postfix* and then apt-get purge *postfix*. I repeated the same thing to remove dovecot as well.

Lastly, I installed postfix and dovecot again and ran the regular configuration, and now it works.

| improve this answer | |
  • 1
    It's a shame you felt you had to go to all this effort when in the comments there are recommendations on precisely what is required. Particularly as you weren't even running postfix – roaima Jan 3 '16 at 18:37
  • It was a mess, I had exim4, sendmail, and postfix. Removed all and reinstalled postfix alone – KingsInnerSoul Jan 3 '16 at 18:41
-2

Use mxtoolbox website tools . there is one named port scanner that will help

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.