iRedMail is a free and open-source mail server solution designed to simplify the installation and configuration of essential mail server components on your server. With iRedMail, you can create multiple mailboxes through a user-friendly web interface, manage mails, folders, and sieve filters conveniently, and store mailboxes using OpenLDAP, MySQL, MariaDB, or PostgreSQL. The iRedMail server is composed of several key components, including Postfix, Dovecot, Nginx, OpenLDAP, Amavisd, SpamAssassin, ClamAV, Roundcube, SOGo, Netdata, and Fail2ban.
In this guide, we will explore how to set up a full-featured mail server using iRedMail on an Ubuntu 18.04 server.
Requirements
- An Ubuntu 18.04 server.
- A static IP address 192.168.0.101 configured on your server.
- A root password set up on your server.
Getting Started
Begin by updating your server to the latest version using the following commands:
apt-get update -y apt-get upgrade -y
After updating, restart your system to apply all changes.
Next, set up a Fully Qualified Domain Name (FQDN) on your server with the command:
hostnamectl set-hostname test.example.com
Edit the /etc/hosts file to add the following line:
nano /etc/hosts
Insert the following line:
192.168.0.101 test.example.com test
Save and close the file. Then, apply the changes using:
hostname -f
Once completed, proceed to the next step.
Install iRedMail
Download the latest iRedMail installer from their website with this command:
wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2
After downloading, extract the installer using:
tar xjf iRedMail-0.9.9.tar.bz2
Navigate to the iRedMail directory and start the installation with:
cd iRedMail-0.9.9 bash iRedMail.sh
Answer the installation questions to configure your iRedMail server. The initial steps include specifying where to store mailboxes, selecting a web server and database, providing a MariaDB root password, domain name, and mail domain administrator password.
Follow through the installation steps by choosing the appropriate options as shown in the screenshots, reviewing your installation summary, and then consenting to the installation by typing ‘y’.
Once the installation completes, you’ll receive important instructions about your new mail server:
************************************************************************* * iRedMail-0.9.9 installation and configuration complete. ************************************************************************* * URLs of installed web applications: * * - Roundcube webmail: https://test.example.com/mail/ * - SOGo groupware: https://test.example.com/SOGo/ * - Netdata monitor: https://test.example.com/netdata/ * - Web admin panel (iRedAdmin): https://test.example.com/iredadmin/ * * Login credentials: * - Username: postmaster@example.com * - Password: admin123 * ****************************************************************************** * Please reboot your system to enable all mail services. ******************************************************************************
Restart your server using:
reboot
Immediately after installation, securely remove the iRedMail config file to protect sensitive information:
rm -rf /root/iRedMail-0.9.9/config
You can monitor your mail server logs using:
tail -f /var/log/mail.log
Update the ClamAV database manually by first stopping the service:
systemctl stop clamav-freshclam
Then update the database:
freshclam
Access iRedMail Web Interface
iRedMail is now successfully installed and configured. Access the web interface by visiting: https://test.example.com/iredadmin in your browser. Note that you might encounter certificate warnings due to using a self-signed certificate.
Log in using your admin credentials to access the dashboard:
You can also access Roundcube webmail to view emails generated post-installation at: https://test.example.com/mail
Congratulations on successfully setting up iRedMail on Ubuntu 18.04. Feel free to reach out if you have any questions.
FAQ
- What components are included in the iRedMail server?
- The iRedMail server includes Postfix, Dovecot, Nginx, OpenLDAP, Amavisd, SpamAssassin, ClamAV, Roundcube, SOGo, Netdata, and Fail2ban.
- Why am I seeing certificate warnings when accessing iRedMail interfaces?
- Certificate warnings appear because iRedMail uses a self-signed certificate by default. To eliminate these warnings, consider installing a valid SSL certificate for your domain.
- Is it necessary to update ClamAV and can I automate this task?
- Updating ClamAV ensures you have the latest virus definitions. Automate updates by configuring the ClamAV update service to run regularly.
- How can I add new mailboxes after setting up iRedMail?
- You can add new mailboxes through the iRedMail web admin interface, providing an intuitive way to manage users and mailboxes.