Question

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

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)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

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