Email Troubleshooting

Email Troubleshooting

It’s necessary to be able to perform email troubleshooting after running your email server. Here are some steps to follow to troubleshoot your email server:

1. If iRedMail web interface is inaccessible. For example, you get this error: 502 gateway error. You should check Nginx logs in /var/log/nginx/ directory to find clues. Also, you may need to check the mail log: /var/log/mail.log. It might be due to the: /etc/hosts file content when you installed the email server, you should re-install it again if email troubleshooting fails.

2. Make sure the following services are running  by running the below on PuTTY SSH client or any Linux terminal:

systemctl status postfix
systemctl status dovecot
systemctl status nginx
systemctl status mariadb
systemctl status clamav-daemon
systemctl status amavis

3. If you enabled the firewall, you should open the following ports in the firewall.

  • HTTP port:  80 
  • HTTPS port: 443
  • SMTP port:  25
  • Submission port: 587 (and 465 if you are going to use Microsoft Outlook mail client)
  • IMAP port:  143 and 993

4. If you are using UFW on Debian/Ubuntu, then run the following command to open TCP port 465:

ufw allow 465/tcp

5. If you are using iptables, then run the following command:

iptables -A INPUT -p tcp --dport 465 -j ACCEPT

6. In case you updated and upgraded the version of PHP, you will get “502 Bad Gateway” error when you try to access roundcube on this URL mail.yourwebsite.com. The solution is very easy. Copy the content of the original www.conf file that was generated by the iRedMail installation. Let’s say the original PHP version before the upgrade is 7.4.

nano /etc/php/7.4/fpm/pool.d/www.conf

Then, add the content of the file to the new PHP version file:

nano /etc/php/8.2/fpm/pool.d/www.conf

Restart php-fpm service by running the below command:

service php8.2-fpm restart

The problem has been solved on iRedMail forum here.