Install and Configure Zimbra Mail Server on Ubuntu 16

The Zimbra Collaboration Suite (ZCS) is a Linux-based Mail Server designed to provide your staff with unified email, calendar, contacts and file-sharing. Both commercial and open source versions are available.

We’ve looked at the open source version as a cost-effective alternative to commercial server-based products such as Microsoft Exchange Server and Software-as-a-Service (SaaS) systems such as Google Apps and Office 365 for Work.

The paid-for version of Zimbra has extra features, most notably ActiveSync for mobile devices and a plugin for Microsoft Outlook. Standard comparative pricing is not available, as the company provides quotes on a per-client basis.

We will explore quickest and easiest way to install Zimbra ( free edition ) mail server along with other components like LDAP, antivirus, antispam, Amavis (amavisd-new) – Content checker, Aspell – Spell checker, MySQL and other collaboration features and a ajax webmail client.

Note: Zimbra recommends to disable firewall in the installation process, once installation has been successfully completed, enable the firewall and add the firewall rules to allow traffic to Zimbra mailserver.

We are using Ubuntu 16.07 for this demo and  below operating systems are also supported.

  • Red Hat® Enterprise Linux® 7 (64-bit)
  • CentOS Linux® 7 (64-bit)
  • SUSE Linux Enterprise Server (SLES) 11

System requirements
Evaluation and Testing

  • Intel/AMD 64-bit CPU 1.5 GHz
  • RAM requirements:
    • For single server installations, a minimum of 8GB of RAM is required.
    • For multi-server installations, contact Zimbra sales for recommendations.
  • 5 GB free disk space for software and logs
  • Temp file space for installs and upgrades*
  • Additional disk space for mail storage

Production environments

  • Intel/AMD 2.0 GHZ+ 64-bit CPU
  • RAM requirements:
    • For single server installations, a minimum of 8GB of RAM is required.
    • For multi-server installations, contact Zimbra sales for recommendations.
  • Temp file space for installs and upgrades*
  • 10 GB free disk space for software and logs (SATA or SCSI for performance, and RAID/Mirroring for redundancy)
  • Additional disk space for mail storage *
  • Temp files space: The zimbra-store requires 5GB for /opt/zimbra, plus additional space for mail storage. The other nodes require 100MB.

General Requirements

  • Firewall Configuration should be set to “No firewall”.
  • RAID-5 is not recommended for installations with more than 100 accounts.

Demo Environment details

  • Ubuntu 16.04 with 4 GB of RAM
  • Ubuntu Server IP – 192.168.1.45
  • Ubuntu Server FQDN – mail.techiesjournal.com
  • DNS Server IP – 192.168.1.45 ( Same server , advisable to keep it in a separate server in your network )
  • Gateway IP – 192.168.1.1
  • Domain name – techiesjournal.com

Configure hostname

Edit /etc/hosts and add the line 192.168.1.45 mail.techiesjournal.com mail. Change 192.168.1.45 with the IP you want to use.

itadmin@ubuntu:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 mail

 

 

Also edit /etc/hostname and the line ‘mail’

 

 

Reboot the system and test the FQDN of your server with the command hostname -f and hostname.

root@mail:~# hostname -f
mail.techiesjournal.com

root@mail:~# hostname
mail

 

 

 

If you are using any cloud based hosting service then make sure you have set the value of parameter preserve_hostname to true.

Install / Configure BIND DNS

We will install BIND name server in the same system where ZCS will be installed. You are free to install BIND name server in another system in your internal network.

Install bind9 by executing following command in the terminal.

 

Now edit the file /etc/bind/named.conf and remove ‘//’ from forwarders and add DNS server IP address like below.

root@mail:~#vi /etc/bind/named.conf

root@mail:~# cat /etc/bind/named.conf.options

Create and edit the file /etc/bind/db.techiesjournal.com and add the following. Change the filename according to your domain name.

$TTL 604800
@ IN SOA mail.techiesjournal.com. admin.techiesjournal.com. (
030512 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ); Negative Cache TTL
;
@          IN          NS          mail
IN         MX        10           mail
IN         A                           192.168.1.45
mail     IN           A            192.168.1.45

Create and edit the file /etc/bind/db.0.0.127 and add the following.

$TTL 3D
@           IN       SOA      mail.techiesjournal.com. admin.techiesjournal.com. (
2           ; Serial
8H       ; Refresh
2H       ; Retry
4W      ; Expire
1D)      ; Minimum TTL
NS       mail.techiesjournal.com.
1           PTR            localhost.

Create and edit the file  /etc/bind/db.1.168.192  and add the following.

$TTL 3D
@          IN          SOA      mail.techiesjournal.com. admin.techiesjournal.com. (
1          ; Serial
8H      ; Refresh
2H      ; Retry
4W     ; Expire
1D)     ; Minimum TTL
NS      techiesjournal.com.
10       PTR          techiesjournal.com.

Restart bind service

root@mail:~#/etc/init.d/bind9 restart

To configure static IP, Edit /etc/network/interfaces and add the following. Change the values according to your network configuration.

source /etc/network/interfaces.d/*.cfg

auto eth0
iface eth0 inet static
                address 192.168.1.45
                netmask 255.255.255.0
                network 192.168.1.0
                broadcast 192.168.1.255
                gateway 192.168.1.1
               dns-search techiesjournal.com
               dns-nameservers 192.168.1.45

Also edit the file /etc/resolv.conf and add the following.

nameserver 192.168.1.45
search techiesjournal.com

Now test your nameservers dns record with dig

root@mail:~# dig techiesjournal.com

; <<>> DiG 9.10.3-P4-Ubuntu <<>> techiesjournal.com
 ;; global options: +cmd
 ;; Got answer:
 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33646
 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
 ; EDNS: version: 0, flags:; udp: 4096
 ;; QUESTION SECTION:
 ;techiesjournal.com. IN A

;; ANSWER SECTION:
 techiesjournal.com. 604800 IN A 192.168.1.45

;; AUTHORITY SECTION:
 techiesjournal.com. 604800 IN NS mail.techiesjournal.com.

;; ADDITIONAL SECTION:
 mail.techiesjournal.com. 604800 IN A 192.168.1.45

;; Query time: 1 msec
 ;; SERVER: 192.168.1.45#53(192.168.1.45)
 ;; WHEN: Mon Nov 20 02:30:23 UTC 2017
 ;; MSG SIZE rcvd: 95

Up to this point, we have configured FQDN of the server and a nameserver.

Download / Install Zimbra

First disable the firewall by executing the following command in the terminal..

root@mail:~# sudo service ufw disable
OR
root@mail:~# sudo service iptables stop

Download zimbra using wget, extract it and run the installer inside the extracted directory.

root@mail:~# cd ~
root@mail:~# wget https://files.zimbra.com/downloads/8.7.0_GA/zcs-8.7.0_GA_1659.UBUNTU16_64.20160628202554.tgz
root@mail:~# tar xf zcs-8.7.0_GA_1659.UBUNTU16_64.20160628202554.tgz
root@mail:~# cd zcs-8.7.0_GA_1659.UBUNTU16_64.20160628202554/
root@mail:~# ./install.sh

Now the installation will start. Read carefully and answer Yes/No or other values according to your configuration.

Do you wish to continue? [N] y
Do you agree with the terms of the software license agreement? [N] y

Checking for installable packages

Use Zimbra’s package repository [Y] y

Configuring package repository

Select the packages to install

Install zimbra-ldap [Y] y
Install zimbra-logger [Y] y
Install zimbra-mta [Y] y
Install zimbra-dnscache [Y] n
Install zimbra-snmp [Y] y
Install zimbra-store [Y] y
Install zimbra-apache [Y] y
Install zimbra-spell [Y] y
Install zimbra-memcached [Y] y
Install zimbra-proxy [Y] y

Checking required space for zimbra-core
Checking space for zimbra-store
Checking required packages for zimbra-store
zimbra-store package check complete.

The system will be modified. Continue? [N] y

Removing /opt/zimbra
Removing zimbra crontab entry…done.
Cleaning up zimbra init scripts…done.
Cleaning up /etc/security/limits.conf…done.

Finished removing Zimbra Collaboration Server.

Installing packages

DNS ERROR resolving MX for mail.techiesjournal.com
It is suggested that the domain name have an MX record configured in DNS
Re-Enter domain name? [Yes] yes
Create domain: [mail.techiesjournal.com] techiesjournal.com
MX: mail.techiesjournal.com (192.168.1.45)

In Main menu select Option 6 and Set the admin password and SMTP

Save the Configuration.

Admin URL : https://mail.techiesjournal.com:7071
Username    : admin
Password     : <Password>

Webmail URL : https://mail.techiesjournal.com
Username   : admin@techiesjournal.com
Password    : <Password>

Conclusion

Although zimbra comes with lot of features, it consumes a lot of server resources. So it is advisable to install it in a server that matches the basic requirements like at least 8GB RAM, 2GHz. processor speed etc.

Please mail me for configuration queries.

About Prasad Paul 51 Articles
Prasad Paul is a Technical Writer, Security Blogger, Network Engineer and IT Analyst. He is a Technology Enthusiast with a keen eye on the Cyberspace and other tech related developments.