2

I've bought a VPS and installed Ubuntu 12.04 on it. I'm using Zpanel for my Control panel and everything seems to be configured well. I can even send and receive mails on my server itself, via the server client 'Roundcube'.

However, when I try to configure a desktop client (either Mac Mail or a 3rd party client, Airmail), it keeps denying the SMTP server, mainly the port. I've tried all the possibilities, from 25, to 1025, 587, 465, etc. None of them seem to be working.

I'm unsure what information I can give to you to precisely help me solving this issue. Just comment if you need to know anything, or please post an answer to this problem.

Note: The mail server address itself are correct, 100% sure.

thanks

edit: This might help

Starting Nmap 5.21 ( http://nmap.org ) at 2014-01-06 15:50 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000060s latency).
Not shown: 993 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
53/tcp   open  domain
80/tcp   open  http
110/tcp  open  pop3
143/tcp  open  imap
3306/tcp open  mysql

Just like I saw (here) only port 25 is open, locally, not when on a remote machine, like my own Mac, outside the VPS.

Info based on request:

root@vps:~# sudo iptables -L -n
Chain INPUT (policy ACCEPT) target    prot opt source               destination         

Chain FORWARD (policy ACCEPT) target     prot opt source              destination         

Chain OUTPUT (policy ACCEPT) target     prot opt source              destination

root@vps:~# sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      2550/master     
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      779/mysqld      
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      758/dovecot     
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      758/dovecot     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1002/apache2    
tcp        0      0 159.253.1.196:53        0.0.0.0:*               LISTEN      744/named       
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      744/named       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      665/sshd        
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      2550/master     
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      744/named       
tcp        0      0 0.0.0.0:4190            0.0.0.0:*               LISTEN      758/dovecot     
tcp6       0      0 :::21                   :::*                    LISTEN      946/proftpd: (accep
tcp6       0      0 :::22                   :::*                    LISTEN      665/sshd        
tcp6       0      0 :::25                   :::*                    LISTEN      2550/master

Nmap aimed at server, from Desktop

Starting Nmap 5.21 ( http://nmap.org ) at 2014-01-06 22:44 CET
Nmap scan report for vps.iscs.nl (159.253.1.196)
Host is up (0.000050s latency).
Not shown: 993 closed ports
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
25/tcp  open  smtp
53/tcp  open  domain
80/tcp  open  http
110/tcp open  pop3
143/tcp open  imap
4
  • Could you add the output of the command sudo netstat -tlnp? Or run nmap from a remote machine aimed at your server? The output from sudo iptables -L -nv might be helpful too.
    – Ladadadada
    Jan 6, 2014 at 16:13
  • Check main post. :) And mmap is in the first box of code, I've already posted that. Thanks in advance! Jan 6, 2014 at 16:23
  • 1
    The nmap I was asking for was one that should be run on a remote box (say, your desktop) and is aimed at the server. The one in the question is aimed at 127.0.0.1 which is localhost. It doesn't test end-to-end connectivity if it was run on the server and it doesn't test anything useful at all if it was run on your desktop. The other two commands are perfect and show that Postfix is running and listening correctly and your firewall is not blocking anything. My suspicion is an external firewall run by your hosting provider that blocks port 25.
    – Ladadadada
    Jan 6, 2014 at 18:47
  • I assume that should be nmap <server address> ? - If yes: Then that's the second nmap in the opening post, just added. Seems identical.. Jan 6, 2014 at 21:46

2 Answers 2

1

Looks like your VPS-hoster deny all and every direct incoming SMTP-connections to your VPS:

/usr/home/me > telnet 159.253.1.196 25
Trying 159.253.1.196...
telnet: connect to address 159.253.1.196: Connection refused
telnet: Unable to connect to remote host

That's a good practice aimed to minimize spam relaying. Your host can accept SMTP connections only from your hoster's MX that perform spam filtering. That means, in general, that you can receive messages for your domain(s) but can't use your VPS' SMTP to relay messages to the others. You have to use some public SMTP-servers like smtp.gmail.com instead.

From the other side, you can easily access your POP/IMAP service to fetch incoming messages from your VPS:

/usr/home/me > telnet 159.253.1.196 143
Trying 159.253.1.196...
Connected to 159.253.1.196.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.

You have to use two different hosts - your own VPS for receiving via POP/IMAP and some other one for submission via SMTP.

0

Yes! I'm so glad this issue has been fixed! After a lot of googling, I found the solution myself. However, many steps need to have been taken!

postfix should be configured well. Gladly I had a second VPS with correct postfix configuration (which I completely forgot) - This one doesn't have a correct configuration either, though. Time to fix that.

Apparantly, after a lot of sudo mmap <server ip> and using telnet <port number> plus googling to port 25, I found out that port 25 is blocked by my ISP. Or.. I think so.

Therefor, I went into the Postfix master file (sudo nano /etc/postfix/master.cf) and pasted this line submission inet n - n - - smtpd within the file. This opens Postfix on port 587 and will have Postfix use port 587 instead of port 25.

After that, just enable port 587 in your server firewall (sudo ufw allow 587) and after checking with my desktop mail client, I can verify: It's working!

If anyone has an issue like this, just open chat / comment or something. I'd like to help. However: My skills are equal to your grandmother's skills with computers, so don't expect much: Though, I managed to fix this... =)

You must log in to answer this question.

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