Install iRedMail Server on CentOS 7 - CentLinux

Latest

Saturday, 7 September 2019

Install iRedMail Server on CentOS 7

Install iRedMail Server on CentOS 7

iRedMail is an Open Source, full featured mail server solution that can save a lot of time for system administrators for complex configurations. iRedMail has support for all major Linux distributions. iRedMail uses other open source software like roundcube, SOGo groupware, Netdata, Nginx and MariaDB to add functionality to it's mail server.

iRedMail is available in two editions, iRedMail (Free) and iRedMail Easy (Commercial). In this article, we are installing iRedMail (free) server on CentOS 7.

I don’t have found a good book on iRedMail server, therefore, I recommend the readers to refer to iRedMail Documentation for further reference.

However, if someone like to recommended a book, please share with me and I will include it in this article.

 

This Article Provides:

     

    Environment Specification:

    We have configured a CentOS 7 virtual machine with following specifications.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 40 GB
    • Operating System - CentOS 7.6
    • Hostname - iredmail-01.example.com
    • IP Address - 192.168.116.200 /24

     

    Verify DNS Settings for iRedMail Server:

    Connect with iredmail-01.example.com using ssh as root user.

    Before configuring a private mail server, it is mandatory to have an Authoritative DNS Server. The DNS server must answer MX (Mail Exchange) queries, so the emails should be redirected to our iRedMail mail server.

    If you have a DNS Server then add MX and A record of iredmail-01.example.com therein.

    To verify our DNS settings for our iRedMail server correctly, we can use dig command.

    [root@iredmail-01 ~]# dig -t MX example.com ; <<>> DiG 9.9.4-RedHat-9.9.4-74.el7_6.2 <<>> -t MX example.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40248 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 3 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;example.com. IN MX ;; ANSWER SECTION: example.com. 3600 IN MX 0 iredmail-01.example.com. ;; AUTHORITY SECTION: example.com. 3600 IN NS dns-01.example.com. ;; ADDITIONAL SECTION: iredmail-01.example.com. 3600 IN A 192.168.116.200 dns-01.example.com. 3600 IN A 192.168.116.4 ;; Query time: 1 msec ;; SERVER: 192.168.116.4#53(192.168.116.4) ;; WHEN: Fri Sep 06 19:23:22 PKT 2019 ;; MSG SIZE rcvd: 121

    From above output, we can see that, the MX and A records of our iRedMail server are properly added in DNS servers.

     

    Stop Existing MTA service on the server:

    By default CentOS 7 installs Postfix as MTA (Mail Transfer Agent). We need to disable it before moving on to iRedMail server installation.

    Stop and disable postfix.service.

    [root@iredmail-01 ~]# systemctl stop postfix.service [root@iredmail-01 ~]# systemctl disable postfix.service Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service. [root@iredmail-01 ~]# systemctl mask postfix.service Created symlink from /etc/systemd/system/postfix.service to /dev/null.

     

    Disable SELinux on CentOS 7 Server:

    iRedMail server is not compatible with SELinux and it is recommended in it’s documentation to disable the SELinux before moving on to installation.

    [root@iredmail-01 ~]# setenforce 0 [root@iredmail-01 ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config && cat /etc/selinux/config # 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. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted

     

    Install EPEL yum Repository on CentOS 7:

    iRedMail software requires some packages from EPEL (Extra Packages for Enterprise Linux) yum repository. Therefore, we are installing EPEL before moving forward.

    [root@iredmail-01 ~]# yum install -y epel-release Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: repo.isra.edu.pk * extras: repo.isra.edu.pk * updates: repo.isra.edu.pk Resolving Dependencies --> Running transaction check ---> Package epel-release.noarch 0:7-11 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: epel-release noarch 7-11 extras 15 k Transaction Summary ================================================================================ Install 1 Package Total download size: 15 k Installed size: 24 k Downloading packages: epel-release-7-11.noarch.rpm | 15 kB 00:11 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : epel-release-7-11.noarch 1/1 Verifying : epel-release-7-11.noarch 1/1 Installed: epel-release.noarch 0:7-11 Complete!

     

    Download and Install iRedMail Server on CentOS 7:

    iRedMail 0.9.9 (Stable) version is available to download at iRedMail official website.

    Download iRedMail software using wget command.

    [root@iredmail-01 ~]# cd /tmp [root@iredmail-01 tmp]# wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2 --2019-09-06 19:40:11-- https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2 Resolving bitbucket.org (bitbucket.org)... 18.205.93.1, 18.205.93.0, 18.205.93.2, ... Connecting to bitbucket.org (bitbucket.org)|18.205.93.1|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://bbuseruploads.s3.amazonaws.com/e392fe45-c2cf-4346-aa1e-6c05d480ba75/downloads/fccd5eb1-6858-4e62-a228-c97b5619b5ed/iRedMail-0.9.9.tar.bz2?Signature=vhsfH3P5VJi1Jp4ptRKow53AXXg%3D&Expires=1567782055&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ&versionId=m_D7CqHrpm4t_pmJmxXSzqz9kk3V4qkd&response-content-disposition=attachment%3B%20filename%3D%22iRedMail-0.9.9.tar.bz2%22 [following] --2019-09-06 19:40:13-- https://bbuseruploads.s3.amazonaws.com/e392fe45-c2cf-4346-aa1e-6c05d480ba75/downloads/fccd5eb1-6858-4e62-a228-c97b5619b5ed/iRedMail-0.9.9.tar.bz2?Signature=vhsfH3P5VJi1Jp4ptRKow53AXXg%3D&Expires=1567782055&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ&versionId=m_D7CqHrpm4t_pmJmxXSzqz9kk3V4qkd&response-content-disposition=attachment%3B%20filename%3D%22iRedMail-0.9.9.tar.bz2%22 Resolving bbuseruploads.s3.amazonaws.com (bbuseruploads.s3.amazonaws.com)... 52.217.37.172 Connecting to bbuseruploads.s3.amazonaws.com (bbuseruploads.s3.amazonaws.com)|52.217.37.172|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 162676 (159K) [application/x-tar] Saving to: âiRedMail-0.9.9.tar.bz2â 100%[======================================>] 162,676 133KB/s in 1.2s 2019-09-06 19:40:24 (133 KB/s) - âiRedMail-0.9.9.tar.bz2â saved [162676/162676]

    Extract downloaded zip file using tar command.

    [root@iredmail-01 tmp]# tar xvf iRedMail-0.9.9.tar.bz2 ... iRedMail-0.9.9/samples/mlmmj/mlmmj-amime-receive iRedMail-0.9.9/samples/openldap/calresource.schema iRedMail-0.9.9/samples/openldap/ldap.conf iRedMail-0.9.9/samples/openldap/slapd.conf iRedMail-0.9.9/samples/openldap/calentry.schema iRedMail-0.9.9/samples/iptables/ip6tables.rules iRedMail-0.9.9/samples/iptables/ip6tables.init.debian iRedMail-0.9.9/samples/iptables/iptables.rules iRedMail-0.9.9/samples/iptables/iptables.init.debian iRedMail-0.9.9/samples/postfix/ldap/ iRedMail-0.9.9/samples/postfix/main.cf.dovecot iRedMail-0.9.9/samples/postfix/main.cf.ldap iRedMail-0.9.9/samples/postfix/main.cf.amavisd iRedMail-0.9.9/samples/postfix/main.cf.postscreen iRedMail-0.9.9/samples/postfix/freebsd/ iRedMail-0.9.9/samples/postfix/postscreen_access.cidr iRedMail-0.9.9/samples/postfix/main.cf iRedMail-0.9.9/samples/postfix/mysql/ iRedMail-0.9.9/samples/postfix/main.cf.pgsql iRedMail-0.9.9/samples/postfix/main.cf.mysql iRedMail-0.9.9/samples/postfix/pgsql/ iRedMail-0.9.9/samples/postfix/helo_access.pcre iRedMail-0.9.9/samples/postfix/master.cf iRedMail-0.9.9/samples/postfix/main.cf.mlmmj iRedMail-0.9.9/samples/postfix/command_filter.pcre iRedMail-0.9.9/samples/postfix/pgsql/catchall_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/virtual_alias_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/sender_login_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/recipient_bcc_maps_domain.cf iRedMail-0.9.9/samples/postfix/pgsql/recipient_bcc_maps_user.cf iRedMail-0.9.9/samples/postfix/pgsql/sender_dependent_relayhost_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/transport_maps_user.cf iRedMail-0.9.9/samples/postfix/pgsql/relay_domains.cf iRedMail-0.9.9/samples/postfix/pgsql/sender_bcc_maps_domain.cf iRedMail-0.9.9/samples/postfix/pgsql/domain_alias_catchall_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/sender_bcc_maps_user.cf iRedMail-0.9.9/samples/postfix/pgsql/domain_alias_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/virtual_mailbox_maps.cf iRedMail-0.9.9/samples/postfix/pgsql/transport_maps_domain.cf iRedMail-0.9.9/samples/postfix/pgsql/transport_maps_maillist.cf iRedMail-0.9.9/samples/postfix/pgsql/virtual_mailbox_domains.cf iRedMail-0.9.9/samples/postfix/mysql/catchall_maps.cf iRedMail-0.9.9/samples/postfix/mysql/virtual_alias_maps.cf iRedMail-0.9.9/samples/postfix/mysql/sender_login_maps.cf iRedMail-0.9.9/samples/postfix/mysql/recipient_bcc_maps_domain.cf iRedMail-0.9.9/samples/postfix/mysql/recipient_bcc_maps_user.cf iRedMail-0.9.9/samples/postfix/mysql/sender_dependent_relayhost_maps.cf iRedMail-0.9.9/samples/postfix/mysql/transport_maps_user.cf iRedMail-0.9.9/samples/postfix/mysql/relay_domains.cf iRedMail-0.9.9/samples/postfix/mysql/sender_bcc_maps_domain.cf iRedMail-0.9.9/samples/postfix/mysql/domain_alias_catchall_maps.cf iRedMail-0.9.9/samples/postfix/mysql/sender_bcc_maps_user.cf iRedMail-0.9.9/samples/postfix/mysql/domain_alias_maps.cf iRedMail-0.9.9/samples/postfix/mysql/virtual_mailbox_maps.cf iRedMail-0.9.9/samples/postfix/mysql/transport_maps_domain.cf iRedMail-0.9.9/samples/postfix/mysql/transport_maps_maillist.cf iRedMail-0.9.9/samples/postfix/mysql/virtual_mailbox_domains.cf iRedMail-0.9.9/samples/postfix/freebsd/mailer.conf iRedMail-0.9.9/samples/postfix/ldap/virtual_group_maps.cf iRedMail-0.9.9/samples/postfix/ldap/catchall_maps.cf iRedMail-0.9.9/samples/postfix/ldap/virtual_alias_maps.cf iRedMail-0.9.9/samples/postfix/ldap/sender_login_maps.cf iRedMail-0.9.9/samples/postfix/ldap/recipient_bcc_maps_domain.cf iRedMail-0.9.9/samples/postfix/ldap/recipient_bcc_maps_user.cf iRedMail-0.9.9/samples/postfix/ldap/sender_dependent_relayhost_maps_domain.cf iRedMail-0.9.9/samples/postfix/ldap/virtual_group_members_maps.cf iRedMail-0.9.9/samples/postfix/ldap/transport_maps_user.cf iRedMail-0.9.9/samples/postfix/ldap/sender_dependent_relayhost_maps_user.cf iRedMail-0.9.9/samples/postfix/ldap/relay_domains.cf iRedMail-0.9.9/samples/postfix/ldap/sender_bcc_maps_domain.cf iRedMail-0.9.9/samples/postfix/ldap/sender_bcc_maps_user.cf iRedMail-0.9.9/samples/postfix/ldap/virtual_mailbox_maps.cf iRedMail-0.9.9/samples/postfix/ldap/transport_maps_domain.cf iRedMail-0.9.9/samples/postfix/ldap/virtual_mailbox_domains.cf iRedMail-0.9.9/samples/spamassassin/local.cf iRedMail-0.9.9/samples/spamassassin/razor.conf iRedMail-0.9.9/samples/rsyslog.d/1-iredmail-iredapd.conf iRedMail-0.9.9/samples/rsyslog.d/1-iredmail-phpfpm.conf iRedMail-0.9.9/samples/rsyslog.d/1-iredmail-dovecot.conf iRedMail-0.9.9/samples/rsyslog.d/1-iredmail-openldap.conf iRedMail-0.9.9/samples/rsyslog.d/1-iredmail-mlmmjadmin.conf iRedMail-0.9.9/samples/openbsd/pf.conf iRedMail-0.9.9/samples/openbsd/ldapd.conf iRedMail-0.9.9/samples/mysql/my.cnf iRedMail-0.9.9/samples/mysql/sql/ iRedMail-0.9.9/samples/mysql/sql/add_first_domain_and_user.sql iRedMail-0.9.9/samples/mysql/sql/delete_anonymous_user.sql iRedMail-0.9.9/samples/mysql/sql/init_vmail_db.sql iRedMail-0.9.9/samples/mysql/sql/remote_grant_permission.sql iRedMail-0.9.9/samples/nginx/sites-available/ iRedMail-0.9.9/samples/nginx/templates/ iRedMail-0.9.9/samples/nginx/nginx.conf iRedMail-0.9.9/samples/nginx/vhosts/ iRedMail-0.9.9/samples/nginx/conf-available/ iRedMail-0.9.9/samples/nginx/conf-available/mime_types.conf iRedMail-0.9.9/samples/nginx/conf-available/default_type.conf iRedMail-0.9.9/samples/nginx/conf-available/log.conf iRedMail-0.9.9/samples/nginx/conf-available/client_max_body_size.conf iRedMail-0.9.9/samples/nginx/conf-available/sendfile.conf iRedMail-0.9.9/samples/nginx/conf-available/0-general.conf iRedMail-0.9.9/samples/nginx/conf-available/server_tokens.conf iRedMail-0.9.9/samples/nginx/conf-available/types_hash_max_size.conf iRedMail-0.9.9/samples/nginx/conf-available/gzip.conf iRedMail-0.9.9/samples/nginx/conf-available/headers.conf iRedMail-0.9.9/samples/nginx/conf-available/cache.conf iRedMail-0.9.9/samples/nginx/conf-available/php-fpm.conf iRedMail-0.9.9/samples/nginx/templates/stub_status.tmpl iRedMail-0.9.9/samples/nginx/templates/redirect_to_https.tmpl iRedMail-0.9.9/samples/nginx/templates/ssl.tmpl iRedMail-0.9.9/samples/nginx/templates/fastcgi_php.tmpl iRedMail-0.9.9/samples/nginx/templates/adminer.tmpl iRedMail-0.9.9/samples/nginx/templates/sogo-subdomain.tmpl iRedMail-0.9.9/samples/nginx/templates/roundcube-subdomain.tmpl iRedMail-0.9.9/samples/nginx/templates/sogo.tmpl iRedMail-0.9.9/samples/nginx/templates/php-catchall.tmpl iRedMail-0.9.9/samples/nginx/templates/iredadmin.tmpl iRedMail-0.9.9/samples/nginx/templates/roundcube.tmpl iRedMail-0.9.9/samples/nginx/templates/netdata-subdomain.tmpl iRedMail-0.9.9/samples/nginx/templates/iredadmin-subdomain.tmpl iRedMail-0.9.9/samples/nginx/templates/hsts.tmpl iRedMail-0.9.9/samples/nginx/templates/netdata.tmpl iRedMail-0.9.9/samples/nginx/templates/misc.tmpl iRedMail-0.9.9/samples/nginx/sites-available/00-default-ssl.conf iRedMail-0.9.9/samples/nginx/sites-available/00-default.conf iRedMail-0.9.9/samples/freebsd/newsyslog.conf.d/ iRedMail-0.9.9/samples/freebsd/syslog.d/ iRedMail-0.9.9/samples/freebsd/syslog.d/mlmmjadmin.conf iRedMail-0.9.9/samples/freebsd/syslog.d/slapd.conf iRedMail-0.9.9/samples/freebsd/syslog.d/dovecot.conf iRedMail-0.9.9/samples/freebsd/syslog.d/iredapd.conf iRedMail-0.9.9/samples/freebsd/syslog.d/php-fpm.conf iRedMail-0.9.9/samples/freebsd/newsyslog.conf.d/slapd iRedMail-0.9.9/samples/freebsd/newsyslog.conf.d/php-fpm iRedMail-0.9.9/samples/freebsd/newsyslog.conf.d/dovecot iRedMail-0.9.9/samples/freebsd/newsyslog.conf.d/iredapd iRedMail-0.9.9/samples/freebsd/newsyslog.conf.d/mlmmjadmin iRedMail-0.9.9/samples/php/fpm/ iRedMail-0.9.9/samples/php/fpm/pool.d/ iRedMail-0.9.9/samples/php/fpm/pool.d/www.conf iRedMail-0.9.9/samples/sogo/sogo.cron iRedMail-0.9.9/samples/sogo/sogo.conf iRedMail-0.9.9/samples/logrotate/php-fpm iRedMail-0.9.9/samples/logrotate/dovecot iRedMail-0.9.9/samples/logrotate/iredapd iRedMail-0.9.9/samples/logrotate/mlmmjadmin iRedMail-0.9.9/samples/logrotate/openldap iRedMail-0.9.9/samples/fail2ban/filter.d/ iRedMail-0.9.9/samples/fail2ban/jail.d/ iRedMail-0.9.9/samples/fail2ban/jail.local iRedMail-0.9.9/samples/fail2ban/action.d/ iRedMail-0.9.9/samples/fail2ban/action.d/auto_wblist.conf iRedMail-0.9.9/samples/fail2ban/jail.d/roundcube.local iRedMail-0.9.9/samples/fail2ban/jail.d/sshd.local iRedMail-0.9.9/samples/fail2ban/jail.d/sshd-ddos.local iRedMail-0.9.9/samples/fail2ban/jail.d/sogo.local iRedMail-0.9.9/samples/fail2ban/jail.d/postfix.local iRedMail-0.9.9/samples/fail2ban/jail.d/nginx-http-auth.local iRedMail-0.9.9/samples/fail2ban/jail.d/postfix-pregreet.local iRedMail-0.9.9/samples/fail2ban/jail.d/dovecot.local iRedMail-0.9.9/samples/fail2ban/filter.d/dovecot.iredmail.conf iRedMail-0.9.9/samples/fail2ban/filter.d/postfix.iredmail.conf iRedMail-0.9.9/samples/fail2ban/filter.d/postfix-pregreet.iredmail.conf iRedMail-0.9.9/samples/fail2ban/filter.d/roundcube.iredmail.conf iRedMail-0.9.9/samples/firewalld/zones/ iRedMail-0.9.9/samples/firewalld/services/ iRedMail-0.9.9/samples/firewalld/services/ssh.xml iRedMail-0.9.9/samples/firewalld/zones/iredmail.xml iRedMail-0.9.9/samples/iredmail/iredmail.mysql iRedMail-0.9.9/samples/iredmail/iredmail.pgsql iRedMail-0.9.9/samples/iredmail/iredmail.schema iRedMail-0.9.9/samples/amavisd/default_spam_policy.sql iRedMail-0.9.9/samples/amavisd/amavisd.pgsql iRedMail-0.9.9/samples/amavisd/amavisd.mysql iRedMail-0.9.9/samples/amavisd/amavisd.conf iRedMail-0.9.9/samples/dovecot/dovecot-sql.conf iRedMail-0.9.9/samples/dovecot/dovecot-share-folder.conf iRedMail-0.9.9/samples/dovecot/imap_share_folder.sql iRedMail-0.9.9/samples/dovecot/systemd/ iRedMail-0.9.9/samples/dovecot/dovecot-ldap.conf iRedMail-0.9.9/samples/dovecot/dovecot23.conf iRedMail-0.9.9/samples/dovecot/dovecot.sieve iRedMail-0.9.9/samples/dovecot/dovecot22.conf iRedMail-0.9.9/samples/dovecot/dovecot-used-quota.conf iRedMail-0.9.9/samples/dovecot/dovecot2-quota-warning.sh iRedMail-0.9.9/samples/dovecot/used_quota.mysql iRedMail-0.9.9/samples/dovecot/systemd/override.conf iRedMail-0.9.9/samples/netdata/netdata.conf iRedMail-0.9.9/samples/netdata/python.d/ iRedMail-0.9.9/samples/netdata/systemd-limits.conf iRedMail-0.9.9/samples/netdata/python.d/mysql.conf iRedMail-0.9.9/samples/netdata/python.d/phpfpm.conf iRedMail-0.9.9/samples/netdata/python.d/postgres.conf iRedMail-0.9.9/samples/netdata/python.d/openldap.conf iRedMail-0.9.9/samples/roundcubemail/global_ldap_address_book.inc.php iRedMail-0.9.9/samples/roundcubemail/config.inc.php iRedMail-0.9.9/samples/postgresql/sql/ iRedMail-0.9.9/samples/postgresql/sql/grant_permissions.sql iRedMail-0.9.9/samples/postgresql/sql/add_first_domain_and_user.sql iRedMail-0.9.9/samples/postgresql/sql/init_vmail_db.sql iRedMail-0.9.9/dialog/virtual_domain_config.sh iRedMail-0.9.9/dialog/pgsql_config.sh iRedMail-0.9.9/dialog/web_applications.sh iRedMail-0.9.9/dialog/ldap_config.sh iRedMail-0.9.9/dialog/optional_components.sh iRedMail-0.9.9/dialog/mysql_config.sh iRedMail-0.9.9/dialog/config_via_dialog.sh iRedMail-0.9.9/tools/find_sasl_login_ip.sh iRedMail-0.9.9/tools/generate_ssl_keys.sh iRedMail-0.9.9/tools/enable_postscreen.sh iRedMail-0.9.9/tools/create_mail_user_OpenLDAP.py iRedMail-0.9.9/tools/fail2ban_unban_ip.sh iRedMail-0.9.9/tools/backup_pgsql.sh iRedMail-0.9.9/tools/backup_sogo.sh iRedMail-0.9.9/tools/generate_password_hash.py iRedMail-0.9.9/tools/backup_ldapd.sh iRedMail-0.9.9/tools/ldap_assign_user_to_groups.py iRedMail-0.9.9/tools/create_mail_user_OpenLDAP.sh iRedMail-0.9.9/tools/find_top_sasl_usernames.sh iRedMail-0.9.9/tools/ldap_move_members_to_another_group.py iRedMail-0.9.9/tools/migrate_sql_alias_table.py iRedMail-0.9.9/tools/backup_mysql.sh iRedMail-0.9.9/tools/create_mail_user_SQL.sh iRedMail-0.9.9/tools/backup_openldap.sh

    Start iRedMail server installation as follows.

    [root@iredmail-01 tmp]# cd iRedMail-0.9.9/ [root@iredmail-01 tmp]# bash iRedMail.sh

    The iRedMail installer automatically installs required packages from CentOS 7 yum repositories and downloads iRedMail's components from it's website.

    01-iredmail-server-installation-welcome-screen

    You are now at the welcome screen of iRedMail installer. Select Yes and press <ENTER>.

    02-iredmail-server-installation-mailbox-directory

    Provide the path to store the users' mailboxes, if you have planned a different disk/partition to store the mailboxes. Otherewise, you can go with the default path as provided by the iRedMail installer.

    Select Next and press <ENTER>.

    03-iredmail-server-installation-preferred-web-server

    The iRedMail installer is now asking to select a preferred web server. Select the Nginx using <SPACE> key.

    Select Next and press <ENTER>.

    04-iredmail-server-installation-preferred-backend

    Select a backend store for email accounts according to your preference. Since the administration is performed by a common iRedAdmin management console, therefore, you may not feel any big difference in functionality.

    Select Next and press <ENTER>.

    05-iredmail-server-installation-ldap-suffix

    Because, we have select OpenLDAP as our backend store, therefore, it is asking for a LDAP suffix. Provide the LDAP suffix according to your environment.

    Press <ENTER>.

    06-iredmail-server-installation-mysql-password

    Although, we don't have selected MariaDB as backend store, but the iRedMail server still uses it internally. Therefore, provide a strong password for MySQL root user. Press <ENTER> to continue.

    07-iredmail-server-installation-mail-domain

    Provide your mail domain and press <ENTER>.

    08-iredmail-server-installation-mail-domain-admin-password

    Provide a strong password for Mail Domain Administrator.

    Press <ENTER> to continue.

    09-iredmail-server-installation-optional-components

    Install any optional components based on your requirement.

    Press <ENTER> to continue.

    ************************************************************************* ***************************** WARNING *********************************** ************************************************************************* * * * Below file contains sensitive infomation (username/password), please * * do remember to *MOVE* it to a safe place after installation. * * * * * /tmp/iRedMail-0.9.9/config * * ************************************************************************* ********************** 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: example.com * Mail domain admin: postmaster@example.com * Additional components: Roundcubemail SOGo netdata iRedAdmin Fail2ban < Question > Continue? [y|N]

    The iRedMail installer is confirming the settings, that we have provided in previous screens.

    Enter y if you are happy with the settings.

    The iRedMail installer will do all the work of installing packages and dependencies automatically.

    python-requests.noarch 0:2.6.0-1.el7_1 python-setuptools.noarch 0:0.9.8-7.el7 python-sqlalchemy.x86_64 0:0.9.8-2.el7 python-webpy.noarch 0:0.37-8.el7 python2-bcrypt.x86_64 0:3.1.6-2.el7 sogo.x86_64 0:4.0.8.20190906-1.el7.centos sogo-activesync.x86_64 0:4.0.8.20190906-1.el7.centos sogo-ealarms-notify.x86_64 0:4.0.8.20190906-1.el7.centos sogo-tool.x86_64 0:4.0.8.20190906-1.el7.centos sope49-gdl1-mysql.x86_64 0:4.9-20190905_1664.el7.1 sope49-ldap.x86_64 0:4.9-20190905_1664.el7.1 spamassassin.x86_64 0:3.4.0-4.el7_5 tmpwatch.x86_64 0:2.11-5.el7 unrar.x86_64 0:5.0.3-1.el7.rf unzip.x86_64 0:6.0-19.el7 uwsgi.x86_64 0:2.0.17.1-2.el7 uwsgi-logger-syslog.x86_64 0:2.0.17.1-2.el7 uwsgi-plugin-python2.x86_64 0:2.0.17.1-2.el7 Dependency Installed: apr.x86_64 0:1.4.8-3.el7_4.1 apr-util.x86_64 0:1.5.2-6.el7 apr-util-ldap.x86_64 0:1.5.2-6.el7 arj.x86_64 0:3.10.22-22.el7 avahi-libs.x86_64 0:0.6.31-19.el7 cabextract.x86_64 0:1.5-1.el7 clamav-filesystem.noarch 0:0.101.4-1.el7 clamav-lib.x86_64 0:0.101.4-1.el7 clucene-core.x86_64 0:2.3.3.4-11.el7 dejavu-fonts-common.noarch 0:2.33-6.el7 dejavu-sans-fonts.noarch 0:2.33-6.el7 fail2ban-firewalld.noarch 0:0.9.7-1.el7 fail2ban-sendmail.noarch 0:0.9.7-1.el7 fail2ban-server.noarch 0:0.9.7-1.el7 fontconfig.x86_64 0:2.13.0-4.3.el7 fontpackages-filesystem.noarch 0:1.44-8.el7 freeze.x86_64 0:2.5.0-16.el7 gd.x86_64 0:2.0.35-26.el7 gdbm-devel.x86_64 0:1.10-8.el7 glibc-devel.x86_64 0:2.17-260.el7_6.6 glibc-headers.x86_64 0:2.17-260.el7_6.6 gnustep-base.x86_64 0:1.24.9-1.el7 gnustep-base-libs.x86_64 0:1.24.9-1.el7 gnutls.x86_64 0:3.3.29-9.el7_6 gperftools-libs.x86_64 0:2.6.1-1.el7 httpd.x86_64 0:2.4.6-89.el7.centos.1 httpd-tools.x86_64 0:2.4.6-89.el7.centos.1 kernel-headers.x86_64 0:3.10.0-957.27.2.el7 lasso.x86_64 0:2.5.1-2.el7 libX11.x86_64 0:1.6.5-2.el7 libX11-common.noarch 0:1.6.5-2.el7 libXau.x86_64 0:1.0.8-2.1.el7 libXpm.x86_64 0:3.5.12-1.el7 libc-client.x86_64 0:2007f-16.el7 libdb-devel.x86_64 0:5.3.21-24.el7 libevent.x86_64 0:2.0.21-4.el7 libjpeg-turbo.x86_64 0:1.2.90-6.el7 libmcrypt.x86_64 0:2.5.8-13.el7 libmemcached.x86_64 0:1.0.16-5.el7 libobjc.x86_64 0:4.8.5-36.el7_6.2 libpcap.x86_64 14:1.5.3-11.el7 libxcb.x86_64 0:1.13-1.el7 libyaml.x86_64 0:0.1.4-11.el7_0 libzip.x86_64 0:0.10.1-8.el7 lm_sensors-libs.x86_64 0:3.4.0-6.20160601gitf9185e5.el7 lzop.x86_64 0:1.03-10.el7 mailcap.noarch 0:2.1.41-2.el7 mailx.x86_64 0:12.5-19.el7 mariadb.x86_64 1:5.5.60-1.el7_5 memcached.x86_64 0:1.4.15-10.el7_3.1 nettle.x86_64 0:2.7.1-8.el7 nginx-all-modules.noarch 1:1.12.2-3.el7 nginx-filesystem.noarch 1:1.12.2-3.el7 nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7 nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7 nginx-mod-http-perl.x86_64 1:1.12.2-3.el7 nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7 nginx-mod-mail.x86_64 1:1.12.2-3.el7 nginx-mod-stream.x86_64 1:1.12.2-3.el7 nomarch.x86_64 0:1.4-11.el7 p7zip.x86_64 0:16.02-10.el7 p7zip-plugins.x86_64 0:16.02-10.el7 pcre2.x86_64 0:10.23-2.el7 perl-Archive-Tar.noarch 0:1.92-2.el7 perl-Archive-Zip.noarch 0:1.30-11.el7 perl-Authen-SASL.noarch 0:2.15-10.el7 perl-BerkeleyDB.x86_64 0:0.51-4.el7 perl-Business-ISBN.noarch 0:2.06-2.el7 perl-Business-ISBN-Data.noarch 0:20120719.001-2.el7 perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-Convert-ASN1.noarch 0:0.26-4.el7 perl-Convert-BinHex.noarch 0:1.119-20.el7 perl-Convert-TNEF.noarch 0:0.18-2.el7 perl-Convert-UUlib.x86_64 2:1.5-1.el7 perl-Crypt-OpenSSL-Bignum.x86_64 0:0.04-18.el7 perl-Crypt-OpenSSL-RSA.x86_64 0:0.28-7.el7 perl-Crypt-OpenSSL-Random.x86_64 0:0.04-21.el7 perl-DBD-MySQL.x86_64 0:4.023-6.el7 perl-DBD-SQLite.x86_64 0:1.39-3.el7 perl-DBI.x86_64 0:1.627-4.el7 perl-DB_File.x86_64 0:1.830-6.el7 perl-Data-Dumper.x86_64 0:2.145-3.el7 perl-Date-Manip.noarch 0:6.41-2.el7 perl-Digest.noarch 0:1.17-245.el7 perl-Digest-HMAC.noarch 0:1.03-5.el7 perl-Digest-MD5.x86_64 0:2.52-3.el7 perl-Digest-SHA.x86_64 1:5.85-4.el7 perl-Digest-SHA1.x86_64 0:2.13-9.el7 perl-Encode-Detect.x86_64 0:1.01-13.el7 perl-Encode-Locale.noarch 0:1.03-5.el7 perl-Error.noarch 1:0.17020-2.el7 perl-ExtUtils-Install.noarch 0:1.58-294.el7_6 perl-ExtUtils-MakeMaker.noarch 0:6.68-3.el7 perl-ExtUtils-Manifest.noarch 0:1.61-244.el7 perl-ExtUtils-ParseXS.noarch 1:3.18-3.el7 perl-File-Listing.noarch 0:6.04-7.el7 perl-GSSAPI.x86_64 0:0.28-9.el7 perl-HTML-Parser.x86_64 0:3.71-4.el7 perl-HTML-Tagset.noarch 0:3.20-15.el7 perl-HTTP-Cookies.noarch 0:6.01-5.el7 perl-HTTP-Daemon.noarch 0:6.01-8.el7 perl-HTTP-Date.noarch 0:6.02-8.el7 perl-HTTP-Message.noarch 0:6.06-6.el7 perl-HTTP-Negotiate.noarch 0:6.01-5.el7 perl-IO-Compress.noarch 0:2.061-2.el7 perl-IO-HTML.noarch 0:1.00-2.el7 perl-IO-Multiplex.noarch 0:1.13-6.el7 perl-IO-Socket-INET6.noarch 0:2.69-5.el7 perl-IO-Socket-IP.noarch 0:0.21-5.el7 perl-IO-Socket-SSL.noarch 0:1.94-7.el7 perl-IO-Zlib.noarch 1:1.10-294.el7_6 perl-IO-stringy.noarch 0:2.110-22.el7 perl-JSON.noarch 0:2.59-2.el7 perl-LWP-MediaTypes.noarch 0:6.02-2.el7 perl-MIME-tools.noarch 0:5.505-1.el7 perl-Mail-DKIM.noarch 0:0.39-8.el7 perl-MailTools.noarch 0:2.12-2.el7 perl-Mozilla-CA.noarch 0:20130114-5.el7 perl-Net-DNS.x86_64 0:0.72-6.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-Net-HTTP.noarch 0:6.06-2.el7 perl-Net-LibIDN.x86_64 0:0.12-15.el7 perl-Net-SMTP-SSL.noarch 0:1.01-13.el7 perl-Net-SSLeay.x86_64 0:1.55-6.el7 perl-Net-Server.noarch 0:2.007-2.el7 perl-NetAddr-IP.x86_64 0:4.069-3.el7 perl-Package-Constants.noarch 1:0.02-294.el7_6 perl-PlRPC.noarch 0:0.2020-14.el7 perl-Razor-Agent.x86_64 0:2.85-15.el7 perl-Socket6.x86_64 0:0.23-15.el7 perl-Sys-CPU.x86_64 0:0.54-4.el7 perl-Sys-MemInfo.x86_64 0:0.91-7.el7 perl-Sys-Syslog.x86_64 0:0.33-3.el7 perl-Test-Harness.noarch 0:3.28-3.el7 perl-Text-Soundex.x86_64 0:3.04-4.el7 perl-Text-Unidecode.noarch 0:0.04-20.el7 perl-TimeDate.noarch 1:2.30-2.el7 perl-URI.noarch 0:1.60-9.el7 perl-Unix-Syslog.x86_64 0:1.1-17.el7 perl-WWW-RobotRules.noarch 0:6.02-5.el7 perl-XML-Filter-BufferText.noarch 0:1.01-17.el7 perl-XML-NamespaceSupport.noarch 0:1.11-10.el7 perl-XML-SAX-Base.noarch 0:1.08-7.el7 perl-XML-SAX-Writer.noarch 0:0.53-4.el7 perl-devel.x86_64 4:5.16.3-294.el7_6 perl-libwww-perl.noarch 0:6.05-2.el7 perl-version.x86_64 3:0.99.07-3.el7 php-cli.x86_64 0:5.4.16-46.el7 php-pdo.x86_64 0:5.4.16-46.el7 php-pear.noarch 1:1.9.4-21.el7 php-process.x86_64 0:5.4.16-46.el7 portreserve.x86_64 0:0.0.5-11.el7 postgresql-libs.x86_64 0:9.2.24-1.el7_5 procmail.x86_64 0:3.22-36.el7_4.1 psmisc.x86_64 0:22.20-15.el7 pyparsing.noarch 0:1.5.6-9.el7 python-babel.noarch 0:0.9.6-8.el7 python-backports.x86_64 0:1.0-8.el7 python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7 python-cffi.x86_64 0:1.6.0-5.el7 python-cherrypy.noarch 0:3.2.2-4.el7 python-html5lib.noarch 1:0.999-6.el7 python-ipaddress.noarch 0:1.0.16-2.el7 python-markupsafe.x86_64 0:0.11-10.el7 python-pycparser.noarch 0:2.14-1.el7 python-six.noarch 0:1.9.0-2.el7 python-urllib3.noarch 0:1.10.2-5.el7 python2-six.noarch 0:1.9.0-0.el7 sope49-appserver.x86_64 0:4.9-20190905_1664.el7.1 sope49-cards.x86_64 0:4.0.8.20190906-1.el7.centos sope49-core.x86_64 0:4.9-20190905_1664.el7.1 sope49-gdl1.x86_64 0:4.9-20190905_1664.el7.1 sope49-gdl1-contentstore.x86_64 0:4.0.8.20190906-1.el7.centos sope49-mime.x86_64 0:4.9-20190905_1664.el7.1 sope49-sbjson.x86_64 0:2.3.1-20190905_1664.el7.1 sope49-xml.x86_64 0:4.9-20190905_1664.el7.1 systemd-python.x86_64 0:219-62.el7_6.9 systemtap-sdt-devel.x86_64 0:3.3-3.el7 t1lib.x86_64 0:5.1.2-14.el7 trousers.x86_64 0:0.3.14-2.el7 unzoo.x86_64 0:4.4-16.el7 uwsgi-plugin-common.x86_64 0:2.0.17.1-2.el7 zip.x86_64 0:3.0-11.el7 Updated: curl.x86_64 0:7.29.0-51.el7_6.3 iproute.x86_64 0:4.11.0-14.el7_6.2 libuuid.x86_64 0:2.23.2-59.el7_6.1 openldap.x86_64 0:2.4.44-21.el7_6 Dependency Updated: glibc.x86_64 0:2.17-260.el7_6.6 glibc-common.x86_64 0:2.17-260.el7_6.6 libblkid.x86_64 0:2.23.2-59.el7_6.1 libcurl.x86_64 0:7.29.0-51.el7_6.3 libmount.x86_64 0:2.23.2-59.el7_6.1 libsmartcols.x86_64 0:2.23.2-59.el7_6.1 systemd.x86_64 0:219-62.el7_6.9 systemd-libs.x86_64 0:219-62.el7_6.9 systemd-sysv.x86_64 0:219-62.el7_6.9 util-linux.x86_64 0:2.23.2-59.el7_6.1 Complete! ******************************************************************** * Start iRedMail Configurations ******************************************************************** [ INFO ] Generate self-signed SSL cert (2048 bits, expire in 10 years). [ INFO ] Generate Diffie Hellman Group with openssl, please wait. [ INFO ] Create required system accounts. [ INFO ] Configure Nginx web server. [ INFO ] Configure PHP. [ INFO ] Configure LDAP server: OpenLDAP. [ INFO ] Setup daily cron job to backup LDAP data with /var/vmail/backup/backup_openldap.sh [ INFO ] Configure MySQL database server. [ INFO ] Setup daily cron job to backup SQL databases with /var/vmail/backup/backup_mysql.sh [ INFO ] Configure Postfix (MTA). [ INFO ] Configure Dovecot (POP3/IMAP/Managesieve/LMTP/LDA). [ INFO ] Configure mlmmj (mailing list manager). [ INFO ] Configure ClamAV (anti-virus toolkit). [ INFO ] Configure Amavisd-new (interface between MTA and content checkers). [ INFO ] Configure SpamAssassin (content-based spam filter). [ INFO ] Configure iRedAPD (postfix policy daemon). [ INFO ] Configure iRedAdmin (official web-based admin panel). [ INFO ] Configure Fail2ban (authentication failure monitor). [ INFO ] Configure Roundcube webmail. [ INFO ] Configure SOGo Groupware (Webmail, Calendar, Address Book, ActiveSync). ************************************************************************* * iRedMail-0.9.9 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] [ INFO ] Copy firewall sample rules: /etc/firewalld/zones/iredmail.xml. < Question > Restart firewall now (with ssh ports: 22)? [y|N] < Question > Would you like to use MySQL configuration file shipped within iRedMail now? < Question > File: /etc/my.cnf. [Y|n] [ INFO ] Copy MySQL sample file: /etc/my.cnf. [ INFO ] Enable SSL support for MySQL server. [ INFO ] Updating ClamAV database (freshclam), please wait ... ClamAV update process started at Fri Sep 6 20:56:33 2019 Downloading main.cvd [100%] main.cvd updated (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr) Downloading daily.cvd [100%] daily.cvd updated (version: 25564, sigs: 1751582, f-level: 63, builder: raynman) Downloading bytecode.cvd [100%] bytecode.cvd updated (version: 330, sigs: 94, f-level: 63, builder: neo) Database updated (6317925 signatures) from database.clamav.net (IP: 104.16.219.84) ******************************************************************** * URLs of installed web applications: * * - Roundcube webmail: https://iredmail-01.example.com/mail/ * - SOGo groupware: https://iredmail-01.example.com/SOGo/ * - netdata (monitor): https://iredmail-01.example.com/netdata/ * * - Web admin panel (iRedAdmin): https://iredmail-01.example.com/iredadmin/ * * You can login to above links with below credential: * * - Username: postmaster@example.com * - Password: Ahmer@1234 * * ******************************************************************** * Congratulations, mail server setup completed successfully. Please * read below file for more information: * * - /tmp/iRedMail-0.9.9/iRedMail.tips * * And it's sent to your mail account postmaster@example.com. * ********************* WARNING ************************************** * * Please reboot your system to enable all mail services. * ********************************************************************

    Remove config file that was used by iRedMail installer, because it contains some critical information like Admin password.

    [root@iredmail-01 iRedMail-0.9.9]# rm -f config

    Restart our CentOS 7 server now using following command.

    [root@iredmail-01 iRedMail-0.9.9]# systemctl reboot

    Allow HTTPS service in CentOS 7 firewall.

    [root@iredmail-01 iRedMail-0.9.9]# firewall-cmd --permanent --add-service=https success [root@iredmail-01 iRedMail-0.9.9]# firewall-cmd --reload success

     

    Verify iRedMail installation on CentOS 7:

    After restart, browse URL https://iredmail-01.example.com/mail/ in a client's browser to access RoundCube WebMail.

    10-iredmail-roundcube-webmail-login

    Login using credentials as provided in above command.

    • Username: postmaster@example.com
    • Password: Ahmer@1234

    11-iredmail-roundcube-webmail-inbox

    We are now at the inbox of postmaster@example.com user.

    Now browse URL https://iredmail-01.example.com/sogo/ to connect to SOGo web client.

    12-iredmail-sogo-groupware-login

    Login using same credentials that we have used above.

    13-iredmail-sogo-groupware-inbox

    We reached at the inbox of SOGo web client.

    Now browse URL https://iredmail-01.example.com/netdata/ to connect to Netdata monitor.

    Login using the same credentials again.

    14-iredmail-netdata-monitor-dashboard

    We are now at the dashboard of Netdata monitor.

    Now browse URL https://iredmail-01.example.com/iredadmin/ to connect to iRedAdmin administration console.

    15-iredmail-iredadmin-login

    Login again using same credentials.

    16-iredmail-iredadmin-dashboard

    We are now at the dashboard of the iRedAdmin administration console.

    All four components are working fine. We have successfully installed iRedMail server on CentOS 7.

    4 comments:

    1. I installed it but I cannot access the page..error connection refused...

      I do see port 443 is closed... I cannot get it to open

      ReplyDelete
      Replies
      1. Hi, Thanks for notifying the missing step. The same has been added now.
        Please execute following command to allow https or 443 port in Linux.

        firewall-cmd --permanent --add-service=https ; firewall-cmd --reload

        Delete