Cannot login after setting up mailserver with Postfix, Dovecot, MySQL, and SpamAssassin

November 1, 2019 105 views
Ubuntu 18.04

I did every step explained in this article: https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin

However, I am still not able to login within my mail application. Also I noticed, the 993 port is not open, neither is the 587 port. How can I fix this? I am using UFW as my firewall, and it has the current rules setup:

Nginx HTTPS                ALLOW       Anywhere                  
OpenSSH                    ALLOW       Anywhere                  
Postfix SMTPS              ALLOW       Anywhere                  
Dovecot Secure IMAP        ALLOW       Anywhere                  
587/tcp                    ALLOW       Anywhere                  
Nginx HTTPS (v6)           ALLOW       Anywhere (v6)             
OpenSSH (v6)               ALLOW       Anywhere (v6)             
Postfix SMTPS (v6)         ALLOW       Anywhere (v6)             
Dovecot Secure IMAP (v6)   ALLOW       Anywhere (v6)             
587/tcp (v6)               ALLOW       Anywhere (v6)
2 Answers

Hello, @FrankHeijden

You can make sure that the ports are open. You can do this with the following command:

sudo ufw allow 587
sudo ufw allow 993

For more information about UFW, please check this link:
https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands

If you prefer to use just iptables:

sudo iptables -A INPUT -p tcp --dport 993 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 993 -m conntrack --ctstate ESTABLISHED -j ACCEPT

For more information about iptables you can check this link:
https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands

I hope this helps!

Regards,
Alex

by Mitchell Anicas
Iptables is the software firewall that is included with most Linux distributions by default. This cheat sheet-style guide provides a quick reference to iptables commands that will create firewall rules are useful in common, everyday scenarios. This includes iptables examples of allowing and blocking various services by port, network interface, and source IP address.

Hi, just a quick note @alexdo, as you can see above from the command output he is using UFW and got his rules in there.

@FrankHeijden Since you followed the tutorial, and setup UFW etc. let’s quickly take a look if the services are running allright:

netstat -nlp | grep 587
netstat -nlp | grep 465

and since UFW is just a frontend of iptables:

iptables -L | grep imap
Have another answer? Share your knowledge.