We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install and Configure iRedMail Server on FreeBSD 13

Learn how to – Install and Configure iRedMail Server on FreeBSD 13.

Welcome to this guide where we discuss how to install and configure the iRedMail server on FreeBSD 13. iRedMail is an open-source mail server solution that is designed to ease deployment, configuration, and use of mail services. iRedMail server can be installed on Linux, FreeBSD and OpenBSD systems.

Below are some of the features of iRedMail server:

  • Fully Open Source: All iRedMail components are built from open source applications. It has bee certified to run on Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, FreeBSD, OpenBSD.
  • Access to Webmail: An intuitive web portal is available for accessing and managing mails, folders, sieve filters – (Roundcube webmail or/and SOGo groupware).
  • Web Admin Panel: As admin user, you get a web admin panel where you manage mail accounts.
  • Unlimited Accounts: You have the powers to create as many mail accounts (domains, users, mailing lists, admins) as you want.
  • Top Security: All mail services are accessed through secured connections – Use of TLS to access POP3, IMAP and SMTP services. Web portals are access via HTTPS. Emails are encrypted in transit using TLS if possible.
  • Antispam & Antivirus: SpamAssassin, ClamAV, SPF, DKIM, greylisting, whitelisting, blacklisting. Quarantining detected spam into SQL database for further review.
  • Support for OpenLDAP, MySQL, MariaDB, and PostgreSQL backend store for mail accounts. Choose what you like.

Install iRedMail Server on FreeBSD 13

Prerequisites

Ton install iRedMail on FreeBSD 13, you need the following:

  1. A FRESH, minimal, working FreeBSD system, no additional ports or binary packages were installed
  2. At least 4 GB memory is required for a low traffic production mail server with spam/virus scanning enabled..
  3. Make sure 3 UID/GID are not used by other user/group: 2000, 2001, 2002.

With the above conditions met, we can now proceed to the steps for installing iRedMail server on FreeBSD 13. Note that all the installations will be done from a ports tree.

Step 1. Configure a Hostname on FreeBSD

Configure a hostname for your FreeBSD system that will work as the domain name of your mail server. It is recommended that you use a fully qualified domain name (FQDN)

Run the command hostname -f to display the current hostname.

Edit the hostname at /etc/rc.conf and add the hostname for localhost resolution at /etc/hosts file.

  • For /etc/rc.conf
$ sudo vim /etc/rc.conf
# Part of File: /etc/rc.conf
hostname="mx.example.com"
  • For /etc/hosts
$ sudo vim /etc/hosts
# Part of file: /etc/hosts
127.0.0.1   mx.example.com mx localhost localhost.localdomain

Remember to replace mx.example.com with your hostname or FQDN.

Verify that the hostname has been updated.

# hostname -f
mx.example.com

If you can’t see the changes, reboot your FreeBSD instance for the changes to take effect.

Step 2. Update FreeBSD Ports Tree and Install Dependencies

Update FreeBSD ports tree using portsnap as sown below:

# portsnap fetch extract update

Install the bash-static package required by iRedMail:

# pkg install bash-static

Step 3. Download RedMail Package on FreeBSD 13

Download the latest release for iRedMail from iRedMail Download Page. At the time of this demo, the latest version of iRedMail server for FreeBSD is 1.5.2

cd /root
wget https://github.com/iredmail/iRedMail/archive/1.5.2.tar.gz

If you don’t have wget package installed to your system, you can install it as shown below:

# pkg install wget

Extract the downloaded package:

tar xzf 1.5.2.tar.gz

Step 4. Install iRedMail Server on FreeBSD 13

Run the installation script to start the installer:

# cd /root/iRedMail-1.5.2/
# bash iRedMail.sh

The above script launches an interactive installer on the command line.

Accept installation

The first screen asks you to accept the installation.

Specify the installation directory

In the next screen, you are required to specify the directory for the installation. The default directory is /var/vmail.

Choose the webserver to use:

Choose preferred backend to store mail accounts

Choose the default backend application to store the mail accounts. Here, I’d suggest you use one that you are familiar with.

If you choose to use OpenLDAP, iRedMail will ask you to provide the LDAP suffix.

If you decide to use MySQL/MariaDB/PostgreSQL, iRedMail will generate a random, strong password for you and store it in the file iRedMail.tips

Configure password for MySQL

Configure the root password for MySQL:

Configure your domain name

Provide a mail domain name. The mail domain name should not be the same as the server’s hostname

Set password for mail admin user

Set a password for the mail domain admin user. This is the password that you will use to login to the webmail and admin panel.

Enable extra features

Enable the extra features.

Review the provided options and start installation.

The installation process takes some time, this depends on the speed of your internet. Upon successfully installing the iRedMail server, the installation script exits with the information below:

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

[ INFO ] Updating SpamAssassin rules (sa-update), please wait ...
[ INFO ] Compiling SpamAssassin rulesets (sa-compile), please wait ...
[ INFO ] Updating ClamAV database (freshclam), please wait ...
ClamAV update process started at Sat Sep 11 12:23:10 2021
daily database available for download (remote version: 26291)
Testing database: '/var/db/clamav/tmp.df482d31e9/clamav-327018fd0f1ad78d1824e9436a2fc8c6.tmp-daily.cvd' ...
Database test passed.
daily.cvd updated (version: 26290, sigs: 1971733, f-level: 90, builder: raynman)
Received an older daily CVD than was advertised. We'll retry so the incremental update will ensure we're up-to-date.
daily database available for update (local version: 26290, remote version: 26291)
Testing database: '/var/db/clamav/tmp.df482d31e9/clamav-ff9ae033db5f3a8a0fb4d2906356cfc3.tmp-daily.cld' ...
Database test passed.
daily.cld updated (version: 26291, sigs: 1971981, f-level: 90, builder: raynman)
main database available for download (remote version: 61)
Testing database: '/var/db/clamav/tmp.df482d31e9/clamav-6ecf91f3573b0fa942716a1517ebaa67.tmp-main.cvd' ...
Database test passed.
main.cvd updated (version: 61, sigs: 6607162, f-level: 90, builder: sigmgr)
bytecode database available for download (remote version: 333)
Testing database: '/var/db/clamav/tmp.df482d31e9/clamav-25498cfa8cdd3bb13756e00f7d01e85f.tmp-bytecode.cvd' ...
Database test passed.
bytecode.cvd updated (version: 333, sigs: 92, f-level: 63, builder: awillia2)
********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: https://mx.example.com/mail/
* - SOGo groupware: https://mx.example.com/SOGo/
*
* - Web admin panel (iRedAdmin): https://mx.example.com/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: postmaster@ownyourlife.com.ng
* - Password: *********
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /root/iRedMail-1.5.2/iRedMail.tips
*
* And it's sent to your mail account postmaster@ownyourlife.com.ng.
*
********************* WARNING **************************************
*
* Please reboot your system to enable all mail services.
*
********************************************************************

Save the above credentials that will be used to access the iRedMail services.

Step 5. iRedMail Credentials

The credentials and details of how to access the various services for iRedMail are saved at /root/iRedMail-x.y.z/iRedMail.tips

This includes:

  • URLs, usernames and passwords of web-based applications
  • Location of mail service related software configuration files.
  • Some other important and sensitive information

A successful installation gives you access to the packages below and their respective dashboards.

Login to the dashboards using the credentials provided in the file /root/iRedMail-x.y.z/iRedMail.tips

The next steps involve adding domains and users to iRedMail server. That topic is covered in the guide below:

17
4.495.728,45