iRedMail

---

setup iRedMail on CentOS 7

iRedMail is an Open Source full featured mail server solution that can spare a lot of time for system administrators for complex configurations, has support for all major Linux distributions and ships with the following Linux packages.

Postfix: SMTP service – default MTA.

Dovecot: POP3/POP3S, IMAP/IMAPS, Managesieve service – default MDA.

Apache: Web server.

MySQL/PostgreSQL: Storing application data and/or mail accounts.

OpenLDAP: Storing mail accounts.

Policyd: Postfix policy server.

Amavisd: An interface between Postfix and SpamAssassin, ClamAV. Used for spam and virus scanning.

Roundcube: Webmail – default MUA.

Awstats: Apache and Postfix log analyzer.

Fail2ban: scans log files (e.g. /var/log/maillog) and bans IPs that show malicious system attempts.

Set hostname and disable Selinux.

[root@c7 ~]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.80.83  mail.worldcm.net  mail

vi /etc/sysconfig/selinux , set the parameter “SELINUX=disabled”

# wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2

# tar -jxvf iRedMail-0.9.9.tar.bz2

# cd iRedMail-0.9.9

# sh iRedMail.sh

 installation.

iRedMail Setup Wizard

11. Next, choose the location where all the mail will be stored. The default directory that iRedMail uses to store mailboxes is /var/vmail/ system path.

If this directory is located under a partition with enough storage to host mail for all your domain accounts then hit on Next to continue.

Otherwise change the default location with a different directory in case if you’ve configured a larger partition dedicated to mail storage.

iRedMail Mail Storage Path

12. On the next step choose the frontend web server through which you will interact with iRedMail. iRedMail administration panel will be completely disabled later, so we will use the frontend web server only to access accounts mail via Roundcube web panel.

If you don’t have thousands of mail accounts per hour accessing the webmail interface you should go with Apache web server do to its flexibility and easy management.

iRedMail Preferred Web Server

13. On this step choose OpenLDAP backend database for compatibility reasons with Samba4 domain controller and hit Next to continue, although we won’t use this OpenLDAP database later once we’ll integrate iRedMail to Samba domain controller.

iRedMail LDAP Backend

14. Next, specify your Samba4 domain name for LDAP suffix as illustrated on the image below and hit Next to continue.

iRedMail LDAP Suffix

15. On the next prompt enter your domain name only and hit Next to move on. Replace tecmint.lan value accordingly.

iRedMail Mail Domain

16. Now, setup a password for postmaster@yourdomain.tld administrator and hit Next to continue.

iRedMail Mail Domain Administrator

17. Next, choose from the list the optional components you want to integrate with your mail server. I strongly recommend to install Roundcube in order to provide a web interface for domain accounts to access mail, although Roundcube can be installed and configured on a different machine for this task in order to free mail server resources in case of high loads.

For local domains with restricted internet access and especially while we’re using domain integration the other components are not very useful, except Awstats in case you need mail analysis.

iRedMail Optional Components

18. On the next review screen type Y in order to apply configuration and start the installation process.

iRedMail Configuration Changes

19. Finally, accept iRedMail scripts to automatically configure your machine firewall and MySQL configuration file by typing yes for all questions.

iRedMail System Configuration

20. After the installation finishes the installer will provide some sensitive information, such as iRedAdmin credentials, web panel URL addresses and the file location with all parameters used at the installation process.

iRedMail Installation Summary

Read the displayed information above carefully and reboot the machine in order to enable all mail services by issuing the following command.

# init 6

21. After the system reboots, login with an account with root privileges or as root and list all network sockets and their associated programs your mail server listens on by issuing the following command.

From the socket list you will see that your mail server covers almost all services required by a mail server to properly function: SMTP/S, POP3/S, IMAP/S and antivirus along with spam protection.

# netstat -tulpn

iRedMail Network Sockets

# chmod 400 /root/iRedMail-0.9.5-1/iRedMail.tips

You can view the contents of the file using the following command.

# cat /root/iRedMail-0.9.5-1/iRedMail.tips

In the contents of the file, you will find the DKIM information:init

URL: ..

Roundcube webmail: https://your_server/mail/

SOGo Groupware: https://your_server/SOGo

Web admin panel (iRedAdmin): httpS://your_server/iredadmin/

Awstats: httpS://your_server/awstats/awstats.pl?config=web (or ?config=smtp for SMTP traffic log)

Create Users & domain from Admin Panel.

To create users first login to admin panel. Use user name as “postmaster@<domain>” and password that we set during installation.

After Login Done. Create a user...

Add a new Domain :

From the admin Panel , Select “Domain & accounts” option and then click on Add domain

Step:5 Access Roundcube (Webmail).

reate Users & domain from Admin Panel.

To create users first login to admin panel. Use user name as “postmaster@<domain>” and password that we set during installation.

Click on Add option and then Select Users.

Add a new Domain :

From the admin Panel , Select “Domain & accounts” option and then click on Add domain

Define the domain name & Organization Name and then further we can create users on newly created domain.

Step:5 Access Roundcube (Webmail).

Open the url in the browser “https://mail.nsitmail.com/mail/” , replace the domain name as per your setup.

Send a test mail to verify the functionality.

As we see that i got the mail from iRedmail mail server, so we can say the iRedmail is successfully installed and configured.

--