20

Install and Configure iRedMail on Rocky Linux 8

 2 years ago
source link: https://computingforgeeks.com/install-and-configure-iredmail-on-rocky-linux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Install and Configure iRedMail on Rocky Linux 8
Search

Welcome to our guide on how to install and configure iRedMail Mail Server on Rocky Linux 8. But before we dive into the installation, let’s first get to know this tool and all it is about.

What is iRedMail?

iRedMail is an open-source mail server rich in features to help ease deployment, configuration, and general daily mail activities for Linux distributions. It is supported by various Linux distributions such as Ubuntu, Red Hat, Debian, FreeBSD, OpenBSD, CentOS, and Rocky Linux 8. iRedMail enables one to create innumerable mailboxes and mail domains in a web-based admin panel.

iRedMail is preferred because of the following:

  • Privacy-One can control the email security
  • It is open-source
  • Webmail- makes it easy to manage mails, folders, sieve filters.
  • Secure By Default- users are forced to use mail services through secure connections such as webmail with HTTPS and IMAP, SMTP, POP3 over TLS
  • Calendars/Contacts/ActiveSync
  • Stores accounts in MariaDB, OpenLDAP, PostgreSQL and MySQL backends.
  • It has a simplified web admin panel
  • Reproduceable and easy to use mail server in depoloyment

With iRedMail installation, the following software will be installed automatically:

  • Dovecot IMAP server
  • ClamAV for anti-virus
  • iRedAPD Postfix policy server for greylisting
  • SpamAssassin for anti-spam
  • Fail2ban for protecting SSH
  • Postfix SMTP server
  • Amavised-new for DKIM signing and verification
  • Nginx web server to serve the admin panel and webmail
  • Roundcube webmail
  • Netdata server monitoring
  • Fail2ban for protecting SSH
  • OpenLDAP, MySQL/MariaDB, or PostgreSQL for storing user information
  • ClamAV for anti-virus
  • mlmmj mailing list manager

For this guide on how to install and configure iRedMail Mail Server on Rocky Linux 8, you will require the following:

  • A Rocky Linux 8 server with a minimum memory of 2 GB.
  • A user with with sudo privileges
  • Mail Server domain name

Install and Configure iRedMail on Rocky Linux 8

With the above conditions met, we will proceed to iRedMail installation on Rocky Linux 8 as below.

Step 1: Add EPEL repository on Rocky Linux 8.

We will begin by adding the EPEL Repository to our Rocky Linux 8 system to be able to install package dependencies.

sudo yum -y install epel-release
sudo yum config-manager --set-enabled powertools

With the above commands executed, update and reboot your system.

sudo dnf -y update
sudo systemctl reboot

Step 2: Set Hostname on Rocky Linux 8

Set a hostname for your server with a subdomain configured with your DNS server. In the below script, replace mail.example.com with your hostname

export HOSTNAME="mail.example.com"
sudo hostnamectl set-hostname $HOSTNAME --static
sudo hostnamectl set-hostname $HOSTNAME --transient

To update your working environment, log out and login back to your system

logout

After a successful login, add the IP address and DNS name mapping to /etc/hosts as below.

$ sudo vi /etc/hosts
192.168.1.10 mail.example.com

Step 3: Set SELinux in Permissive mode

For the iRedMail server to work on your Rocky Linux 8 system, you’ll need to set SELinux from enforcing mode to permissive as below.

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

Verify the SELinux status.

$ sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33

Step 4: Download iRedMail on Rocky Linux 8

The latest stable release of iRedMail is downloaded from the official downloads page

As per the time of documenting this guide, the latest version is v1.4. Alternatively, you can pull it using the cURL command as below.

wget https://github.com/iredmail/iRedMail/archive/1.4.2.tar.gz

Now extract the downloaded file but first, you will require the below tools

sudo yum -y install tar bzip2

Now proceed and extract as below.

tar xvf 1.4.2.tar.gz

Step 5: Install iRedMail Mail Server on Rocky Linux 8.

We are now ready to install iRedMail on Rocky Linux 8. Navigate to the extracted directory.

cd iRedMail-*/

While in the directory, make the iRedMail.sh file executable

chmod +x iRedMail.sh

Then install iRedMail on Rocky Linux 8 as below:

sudo ./iRedMail.sh

The required dependencies will be installed as below

When done, proceed to the installation wizard as shown.

On this page, click yes and proceed with the installation.

In the next window, you are required to specify a directory to store mailboxes. Read the notes carefully before changing the storage directory.

Here, you are required to choose a web server you want to use. The default selection is nginx, which is still okay.

Choose the backend to store your mails. Here, you have an option to choose one that you are familiar with. For the purposes of this guide, I will go with OpenLDAP.

If you chose OpenLDAP you have to provide an LDAP suffix from the components of your domain name as below.

Set a password for MySQL root user.

In the next window, set an email domain name that is not similar to your hostname

Provide a password for the email domain administrator.

Here, you are required to choose optional components. The 4 items are selected by default so you just press enter and proceed.

Now review and agree to your configurations. Type Y to begin the installation of the components.

************************************************************************
********************** Review your settings *****************************
*************************************************************************

* Storage base directory:               /var/vmail
* Mailboxes:                            
* Daily backup of SQL/LDAP databases:   
* Store mail accounts in:               OpenLDAP
* Web server:                           Nginx
* First mail domain name:               testserver.com
* Mail domain admin:                    [email protected]
* Additional components:                Roundcubemail netdata iRedAdmin Fail2ban

< Question > Continue? [y|N]y

Accept the Firewall configurations provided by iRedMail and restart the firewall as below.

* iRedMail-1.4.0 installation and configuration complete.
*************************************************************************

[ INFO ] Disable SELinux in /etc/selinux/config.
< Question > Would you like to use firewall rules provided by iRedMail?
< Question > File: /etc/firewalld/zones/iredmail.xml, with SSHD ports: 22. [Y|n]y
[ INFO ] Copy firewall sample rules.
< Question > Restart firewall now (with ssh ports: 22)? [y|N]y
[ INFO ] Restarting firewall ...
< Question > Would you like to use MySQL configuration file shipped within iRedMail now?
< Question > File: /etc/my.cnf. [Y|n]y

With iRedMail installation complete, you will be given the URL of the webmail and web admin panel login credentials. Save this information as it is important.

bytecode.cvd updated (version: 333, sigs: 92, f-level: 63, builder: awillia2)
********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: https://mail.example.com/mail/
* - netdata (monitor): https://mail.example.com/netdata/
*
* - Web admin panel (iRedAdmin): https://mail.example.com/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: [email protected]
* - Password: yourpassword
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /home/rockylinux/iRedMail-1.4.0/iRedMail.tips
*
* And it's sent to your mail account [email protected].
*
********************* WARNING **************************************
*
* Please reboot your system to enable all mail services.
*
********************************************************************

Reboot your Rocky Linux 8 server.

sudo reboot

Step 6: Access iRedMail Web admin Panel

When the system is back online, access the web admin panel using the URL provided earlier https://your-domain.com/iredadmin/ or https://IP_Address/ireadmin/

Log into the panel using the credentials you saved in step 6. On successful login, you should see this page.

Add Domains and accounts on iRedMail.

This is achieved by navigating to the Add Domains and accounts tab as shown.

While on this tab, click on the + Add domain button on your far right and enter the required details. Once done, click Add and the domain will be added successfully

Add Admin and user accounts.

Navigate to the Admins tab as shown.

Click on + Add admin and fill in the required credentials.

Logs in iRedMail.

Manage logs in iRedMail by clicking on the Activities tab and select the log for the user you want.

Under the choose action button there are these activities:

Alternatively, adding a domain, user or admin can be easily done using the + button as shown.

Step 7: Send/Receive Mails using iRedMail.

To be able to send and receive mails using iRedMail, you will need to login to the webmail using the URL https://your-domain-name/mail/ or https://IP_Address/mail/

Login with the same credentials you used in the web admin panel. You should see this page:

While on this page, you can view sent messages in your inbox and also compose and sent messages. For example, if you want to send a mail, click on Compose. From this interface, enter the required information, you can also attach a document of file and click send (at the bottom of the page) when done.

Step 8: Access system Metrics using iRedMail.

To access the system metrics, use the URL https://your-domain-name/netdata/ or https://IP_Address/netdata/.

You will be required to log in using the credentials you have been using in the above sites. On successful login, you will be able to see this page where the system’s metrics are displayed.

Step 9: Secure iRedMail With Let’s Encrypt SSL Certificates

Both the desktop mail client users and webmail client users will see a warning when accessing the web admin panel since iRedMail server is using a self-signed TLS certificate. This issue can be fixed by obtaining and installing a free Let’s Encrypt certificate. Refer to the below guide on how to:

Secure iRedMail Server with Let’s Encrypt SSL Certificate

Conclusion.

That marks the end of our guide on how to install and configure iRedMail Mail Server on Rocky Linux 8. I hope you enjoyed it!

See more on this page:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK