I am having trouble getting the final parts of my mail server up and working. I followed this tutorial to get everything set up on the mail server side. I have installed roundcube for webmail and configured it but it is saying "error connecting, connection refused" when attempting to connect to it using IMAP. This is thorough the "test imap" section of its installer. Also it is giving me an error message about perissions for it's log and temp folders but that's not as important as acutally getting mail to work.

I have also tried connecting to the mail server using thunderbird however it cannot establish a connection either and I know my login information is correct.

I know that the databases are working correctly based on the roundcube installer telling me that they have been "successfully initialized". Here are my firewall rules

-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 465 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 487 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 993 -j ACCEPT

Which I set up in iptables. I have modified them from what I used in this tutorial

I'm not sure what to try next. Any help would be wonderful!

I am using Ubuntu 14.04 server, apache 2.4.7, roundcube 1.0.1, and the latest versions of dovecot and postfix. The email databases are contained in mysql. I am running this on a VPS server.

UPDATE: I have changed from iptables to using ufw. I have run the following commands to set up a basic firewall with ufw.

ufw default deny
ufw allow ssh
ufw allow http
ufw allow https
ufw allow imap
ufw allow imaps
ufw allow smtp

I then used telnet to check all of the mail ports. But Port 993 isnt working even though ufw says both 993 and 993/tcp are open. What am I missing?

  • You might try UFW instead of manually configuring iptables. – Paul May 31 '14 at 6:02
  • Database connection issue probably isn't firewall related. – Paul May 31 '14 at 21:03

The solution was to reset the iptables then switch to using ufw.

I needed to run these commands:

sudo ufw disable
sudo ufw default deny
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow smtp
sudo ufw allow imaps
sudo ufw allow pop3s
sudo ufw enable
sudo ufw status

That combined with completely removing and installing dovecot from my system worked (a config file was corrupted). Roundcube works now correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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