iRedMail is a bash script for software installation which is necessary to setup the e-mail server. This script includes the following components:
- Dovecot – POP3 and IMAP services;
- Postfix – SMTP-server;
- Cluebringer – politics service of the Postfix server;
- SpamAssassin – spam filter;
- ClamAV – antivirus;
- Amavisd – interface for exchange between Mail Transfer Agent, antivirus scanner ClamAV and antispam filter SpamAssassin;
- Roundcube – web-interface to enter the email box and manage letters and contacts;
- iRedAdmin – web-interface to manage users accounts, mailboxes and mail domains.
Also, it is possible to choose and install additional components (for example, the Apache web server, PHP, MySQL database, PostgreSQL or OpenLDAP directory service). Depending on Your choice you can use iRedMail to install the necessary components to manage post service via web interface (phpMyAdmin, phpPgAdmin or phpLDAPadmin).
Before installing iRedMail, make sure you have all the necessary records on DNS servers.
For the correct work of iRedMail check the following settings:
- unihost.com A 127.0.0.1 3600 (TTL)
- mail.unihost.com A 127.0.0.1 3600 (TTL)
- unihost.com MX 10 mail.unihost.com 3600 (TTL)
- unihost.com NS ns1.skydns.net 3600 (TTL)
- unihost.com NS ns2.skydns.net 3600 (TTL)
- unihost.com TXT v=spf1 ip4:127.0.0.1 a mx ~all 3600 (TTL)
- ftp.unihost.com A 127.0.0.1 3600 (TTL)
- pop.unihost.com A 127.0.0.1 3600 (TTL)
We typed unihost.com on the place where the name of your domain must be, instead of 127.0.0.1 – your necessary IP.
3600 (TTL) – it is the update period of the DNS server (in seconds), this value is optimal (advise you not to change it).
If you use your own servers as DNS, then the discription of the domain zone will be like this:
If you use outside DNS servers, you have to get this records from the Client Area of the owners of that DNS servers. If your domain is parked at ns1.skydns.net and ns2.skydns.net (our DNS servers), you may add all the necessary records from your Client Area. Details how to do it are here.
To install iRedMail you need clean and updated server to avoid any conflicts with the software!
Let`s start. First you have to update the system and the packets. Run the following commands one by one:
yum upgrade -y
yum update -y
After this you have to edit /etc/hosts file using any text editor you like:
127.0.0.1 mail.unihost.com mail localhost
Then deactivate selinux protection. Open /etc/selinux/config file with any text editor and change the value of directive SELINUX=enforcing to disabled. Your file will be like this:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing — SELinux security policy is enforced.
# permissive — SELinux prints warnings instead of enforcing.
# disabled — No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
# targeted — Targeted processes are protected,
# minimum — Modification of targeted policy. Only selected processes are protected.
# mls — Multi Level Security protection.
Reboot server and check its work using selinux command:
If everything is ok, you will see: Disabled
Go to /root and download iRedMail-0.9.2.tar.bz2archive:
tar -xjf iRedMail-0.9.2.tar.bz2
Go to extracted folder and install iRedMail:
If everything is right you will see the dialogue window where you have to select Yes and press Enter:
Then you have to select a directory to save mails. You will see a directory chosen by default (you may change it or not as you want). Press Next:
If LAMP or LEMP are not installed on the server, you will have to install one of these web-servers:
Choose the database server:
Enter the password of root from SQL user and press Next:
If there are no eails names created before you will have to do it. Type the necessary name and press Next:
Create a password for the domain administrator to enter the web-interface management. Enter the password and press Next:
You will see the list of optional components. Press SPACE, choose and click on Next button:
Next, we will see a message indicating that the configuration is complete and confirm that you can start the installation. Click Y and Enter.
During the installation you will need several times to press Y (use firewall and sshd, restart the firewall and sshd, and use /etc/my.cnf for iRedMail)
At the end of installation we will see the access data to the web interfaces and the message about successful installation with a recommendation to restart the server to turn on email services:
Update the database of antivirus ClamAV:
Setup any email client, for example, Mozilla Thunderbird:
As you can see, Mozilla Thunderbird
automatically “catch” all settings and is ready to use!
We successfully installed iRedMail!