Zimbra 10 FOSS Installation Guide

Ask questions about your setup or get help installing ZCS server (ZD section below).
Post Reply
innotelinc
Posts: 12
Joined: Tue Sep 05, 2023 3:49 pm
Location: Springfield, MA, USA
ZCS/ZD Version: Release 10.0.5.GA.1000.UBUNTU20.64
Contact:

Zimbra 10 FOSS Installation Guide

Post by innotelinc »

Hello all, new subscriber but long time follower, just wanted to provide my input on a fresh Zimbra 10 Build Installation instructions.

It seems there are NO clear set of instructions for getting this thing working, but after long hours, days, (and nights), I have finally been able to put together something to help us all out.

First thing is first hello everyone I'm Darnel, and I'm glad to be here and share this important knowledge any questions feel free to ask, PM, or however you'd like to get in contact with me. Info in sig.

Now on to the show!

Zimbra 10 Build Instructions (Updated to 10.0.5) 11/5/23
------------------------
These instructions are for Ubuntu 20.04 x64

I have installed this on Proxmox with a mail relay for testing on a home internal network with port 25 blocked by my ISP (Comcast). But it should work on a regular system under normal circumstances :D

Notes:
I have created a remote zimbra repo for this process which anyone is free to use.
Comments will be listed and start with #

Using a clean Ubuntu 20.04 system perform the following steps:

Pre-requisites
------------

#Move to working directory
cd /usr/src

#Install Deps Ubuntu
apt update && apt -y upgrade
apt -y install gcc make g++ openssl libxml2-dev perl net-tools gnupg2

#Stop & Remove Postfix
systemctl stop postfix
apt -y remove postfix

#Install Webmin for Administration
cd /usr/src
wget https://acscorp.us/files/webmin_current.deb
dpkg -i webmin_current.deb
apt -fy install

#Set Hostname
hostnamectl set-hostname hostname.domain.tld --static

#Disable systemd-resolved Stub
sudo sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
systemctl stop systemd-resolved
sudo unlink /etc/resolv.conf
echo -e "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf

#Edit Hosts
nano /etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.1.2 hostname.domain.tld hostname #Change IP to local or public IP address of system (ip addr)

#Disable Firewall & Reboot
systemctl stop ufw
systemctl disable ufw
systemctl stop iptables
systemctl disable iptables
systemctl stop ip6tables
systemctl disable ip6tables
iptables -F

reboot

#Install Zimbra

#Zimbra remote repo for Ubuntu 20.04
cat > /etc/apt/sources.list.d/innotel.list<<EOF
deb [arch=amd64] https://repo.innotel.us/apt/87 focal zimbra
deb [arch=amd64] https://repo.innotel.us/apt/1000 focal zimbra
deb [arch=amd64] https://repo.innotel.us/apt/1000-ne focal zimbra
deb-src [arch=amd64] https://repo.innotel.us/apt/87 focal zimbra
deb [arch=amd64] https://repo.innotel.us/apt/onlyoffice focal zimbra
deb-src [arch=amd64] https://repo.innotel.us/apt/onlyoffice focal zimbra
EOF

#Add Zimbra Keyring
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9BE6ED79

#Update Packages
apt update

#Install Zimbra 10.0.4 FOSS
cd /usr/src
wget https://repo.innotel.us/zcs-10.0.5_GA_1 ... 033841.tgz
tar zxf zcs-10.0.5_GA_1000.UBUNTU20_64.20231106033841.tgz
cd zcs-10.0.5_GA_1000.UBUNTU20_64.20231106033841
./install.sh

#Change email domain and resume setup

7,4 <set password>
1,7,37 <set timezone> (America/New_York)
r,a,Yes,[Enter],[Enter],Yes <complete setup>

#Redirect to HTTPS only
su zimbra
zmprov ms `zmhostname` zimbraReverseProxyMailMode redirect
zmprov ms mail.innotel.us zimbraMtaLmtpHostLookup native
zmprov mcf zimbraMtaLmtpHostLookup native
zmproxyctl restart
exit

#Optional - Create Swap
dd if=/dev/zero of=/opt/zimbra/1024Mb.swap bs=1M count=1024
chmod 600 /opt/zimbra/1024Mb.swap
mkswap /opt/zimbra/1024Mb.swap
swapon /opt/zimbra/1024Mb.swap

#Install LetsEncrypt SSL Certificate
cd /usr/src
apt update
apt -y install python3 python3-venv libaugeas0
apt -y remove certbot
python3 -m venv /opt/certbot/
/opt/certbot/bin/pip install --upgrade pip
/opt/certbot/bin/pip install certbot certbot-apache
ln -s /opt/certbot/bin/certbot /usr/bin/certbot

#Automatic renewal setup
echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew --force-renewal --preferred-chain "ISRG Root X1"" | tee -a /etc/crontab > /dev/null

#Monthly Update for Certbot
/opt/certbot/bin/pip install --upgrade certbot certbot-apache

#Stop Zimbra Mailbox & Proxy
su zimbra
zmproxyctl stop
zmmailboxdctl stop
exit

#Request Certificate
certbot certonly --key-type rsa --preferred-chain "ISRG Root X1" --standalone -d hostname.domain.tld

#PrivKey
/etc/letsencrypt/live/hostname.domain.tld/privkey.pem
#Cert
/etc/letsencrypt/live/hostname.domain.tld/fullchain.pem

#Add ISRG Root Certificate
wget --no-check-certificate -O /tmp/ISRG-X1.pem https://letsencrypt.org/certs/isrgrootx1.pem.txt
cat /tmp/ISRG-X1.pem >> /etc/letsencrypt/live/hostname.domain.tld/fullchain.pem

#Make Lets Encrypt Zimbra Directory
mkdir /opt/zimbra/ssl/letsencrypt
cp /etc/letsencrypt/live/hostname.*/* /opt/zimbra/ssl/letsencrypt/

#Set Permissions
chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/*

#Verify Certificate
su zimbra
cd /opt/zimbra/ssl/letsencrypt
/opt/zimbra/bin/zmcertmgr verifycrt comm privkey.pem cert.pem fullchain.pem

#Make Backup & Create Commercial Key
cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d")
cp /opt/zimbra/ssl/letsencrypt/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key

#Deploy Certificate
/opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem fullchain.pem

#Start Zimbra Mailbox & Proxy
zmproxyctl start
zmmailboxdctl start
exit

#Remove Unnecessary files
apt -y autoremove

#If you receive snap loop messages or emails
#Disable snap reporting emails
df -Th #Check for /dev/loop and edit the line below to fit the number of loops
su - zimbra
zmlocalconfig -e zmstat_df_excludes='/dev/loop0:/dev/loop1:/dev/loop2:/dev/loop3:/dev/loop4'
zmstatctl restart
exit

swapoff -a

#Update your webmin certificate at https://localhost:10000 - [Webmin] - [Webmin Configuration] - [SSL Encryption]

####################################################################
#Sendgrid Setup for Outbound Relay
#Used incase your IP is blacklisted to send e-mail

su - zimbra

echo smtp.sendgrid.net apikey:<apikey> > /opt/zimbra/conf/relay_password

postmap /opt/zimbra/conf/relay_password
postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslAuthEnable yes
zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
zmprov ms `zmhostname` zimbraMtaSmtpSaslSecurityOptions noanonymous
zmprov ms `zmhostname` zimbraMtaRelayHost smtp.sendgrid.net:587
exit

####################################################################

#Add Zextras Zimbra Theme

cd /usr/src
wget https://acscorp.us/files/zextras-theme-installer.zip
unzip zextras-theme-installer.zip
cd zextras-theme-installer
chmod +x install.sh
./install.sh <enter> <enter>

su - zimbra -c 'zmskindeploy /opt/zimbra/jetty/webapps/zimbra/skins/zextras/'

#Disable Modern UI

nano /opt/zimbra/jetty_base/webapps/zimbra/WEB-INF/classes/messages/ZmMsg.properties

#Edit lines (673, 679, 680)to reflect

clientAdvanced = Default
clientPreferred =
clientModern =

#Around line 700 remove ----> lines search for fmt:message key="clientPreferred" and fmt:message key="clientAdvanced"


----> <option value="preferred" <c:if test="${client eq 'preferred'}">selected</c:if> > <fmt:message key="clientPreferred"/></option>
<option value="advanced" <c:if test="${client eq 'advanced'}">selected</c:if>> <fmt:message key="clientAdvanced"/></option>
<c:if test="${modernSupported}">
----> <option value="modern" <c:if test="${client eq 'modern'}">selected</c:if>> <fmt:message key="clientModern"/></option>
</c:if>

#So it looks like

<option value="advanced" <c:if test="${client eq 'advanced'}">selected</c:if>> <fmt:message key="clientAdvanced"/></option>
<c:if test="${modernSupported}">
</c:if>

#Restart Zimbra
su - zimbra -c 'zmcontrol restart'

System setup complete visit your mail server at https://hostname.domain.tld

Optional setup for mail relay incase your ISP blocks incoming port 25. You need to have a remote server to install postfix to relay to port 2525 on Zimbra server

Zimbra Postfix
-------------
#Change SMTP Port to 2525 for incoming relay
nano /opt/zimbra/common/conf/master.cf.in

#ADD UNDER
smtp inet n - n - - smtpd

#THIS LINE
2525 inet n - y - - smtpd

su - zimbra
postfix reload
exit

su - zimbra -c 'zmcontrol restart'

#Confirm port is now active
netstat -plutn | grep 2525


Install Mail Relay (Remote Server)
-----------------------------------
cd /usr/src
git clone https://github.com/innotelinc/emailrelay.git
cd emailrelay
./configure --prefix=/usr --with-openssl=/usr/bin/openssl && make && make install

systemctl enable /usr/src/emailrelay/etc/emailrelay.service


nano /usr/etc/emailrelay.conf


as-proxy hostname.domain.tld:2525
spool-dir /usr/var/spool/emailrelay
remote-clients


#Startup Command
systemctl start emailrelay

#Manual Command
emailrelay --as-proxy hostname.domain.tld:2525 --spool-dir /usr/var/spool/emailrelay --remote-clients

#User Guide
https://github.com/innotelinc/emailrela ... erguide.md

#References
https://github.com/innotelinc/emailrela ... ference.md
Last edited by innotelinc on Mon Nov 06, 2023 4:30 am, edited 2 times in total.
Release 10.0.5.GA.1000.UBUNTU20.64 UBUNTU20_64 FOSS edition.
ask me how @ dhunter@innotel.us
popsmile
Posts: 3
Joined: Sun Aug 20, 2023 12:08 pm

Re: Zimbra 10 FOSS Installation Guide

Post by popsmile »

Thank you for share 8-)
tunguyen1080
Posts: 4
Joined: Wed Jun 29, 2022 7:57 am
Location: Việt Nam
ZCS/ZD Version: 8.8.15, 10.0.5

Re: Zimbra 10 FOSS Installation Guide

Post by tunguyen1080 »

Hi Darnel!

I have successfully installed your zimbra 10 foss. All services are running but when I upload the text file, the document cannot be processed with onlyoffice. Can you help me fix it

Code: Select all

  
  	amavis                  Running
        antispam                Running
        antivirus               Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        onlyoffice              Running
        opendkim                Running
        proxy                   Running
        service webapp          Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running

Code: Select all

HTTP ERROR 400 unsupported format
URI:	/service/home/admin@abc123.com/Briefcase/check.docx
STATUS:	400
MESSAGE:	unsupported format
SERVLET:	UserServlet
innotelinc
Posts: 12
Joined: Tue Sep 05, 2023 3:49 pm
Location: Springfield, MA, USA
ZCS/ZD Version: Release 10.0.5.GA.1000.UBUNTU20.64
Contact:

Re: Zimbra 10 FOSS Installation Guide

Post by innotelinc »

I'm getting this same error as well it seems to have something to do with the url linking /service/home without that part it would work correctly have to dig into the code, im new at this so please bear with me.
Release 10.0.5.GA.1000.UBUNTU20.64 UBUNTU20_64 FOSS edition.
ask me how @ dhunter@innotel.us
umashankar.avagadda
Zimbra Employee
Zimbra Employee
Posts: 114
Joined: Wed Apr 05, 2023 6:29 am

Re: Zimbra 10 FOSS Installation Guide

Post by umashankar.avagadda »

tunguyen1080 wrote: Fri Sep 08, 2023 4:05 am Hi Darnel!

I have successfully installed your zimbra 10 foss. All services are running but when I upload the text file, the document cannot be processed with onlyoffice. Can you help me fix it

Code: Select all

  
  	amavis                  Running
        antispam                Running
        antivirus               Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        onlyoffice              Running
        opendkim                Running
        proxy                   Running
        service webapp          Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running

Code: Select all

HTTP ERROR 400 unsupported format
URI:	/service/home/admin@abc123.com/Briefcase/check.docx
STATUS:	400
MESSAGE:	unsupported format
SERVLET:	UserServlet
OnlyOffice is supported in the Network Edition.
innotelinc
Posts: 12
Joined: Tue Sep 05, 2023 3:49 pm
Location: Springfield, MA, USA
ZCS/ZD Version: Release 10.0.5.GA.1000.UBUNTU20.64
Contact:

Re: Zimbra 10 FOSS Installation Guide

Post by innotelinc »

That would solve that issue. I've created a new build for 10.0.4 at http://repo.innotel.us/zcs-10.0.4_GA_10 ... 123303.tgz
Release 10.0.5.GA.1000.UBUNTU20.64 UBUNTU20_64 FOSS edition.
ask me how @ dhunter@innotel.us
Rusi
Posts: 2
Joined: Sat Sep 16, 2023 3:03 pm

Re: Zimbra 10 FOSS Installation Guide

Post by Rusi »

Hi Folks!

I just registered now, to tell you a big THANKS!
Especcially to innotelinc for the great job! :D

On the main page it is writen: 10.0.4_GA_1000.NETWORK
However:
zmcontrol -v
Release 10.0.4.GA.1000.UBUNTU20.64 UBUNTU20_64 FOSS edition.

??
Last edited by Rusi on Sat Sep 16, 2023 4:30 pm, edited 1 time in total.
asark
Posts: 2
Joined: Thu Mar 08, 2018 9:59 am

Re: Zimbra 10 FOSS Installation Guide

Post by asark »

A great guide!

Has anyone used the build from here? https://zintalio.com/
Rusi
Posts: 2
Joined: Sat Sep 16, 2023 3:03 pm

Re: Zimbra 10 FOSS Installation Guide

Post by Rusi »

asark wrote: Wed Sep 20, 2023 7:23 pm A great guide!

Has anyone used the build from here? https://zintalio.com/
Hello,

Yes I tried. I got a link from them... Unfortunately it was not working. I do not have instructions of the installation like do by innotelinc...
It has some problem with the ldap database, and also some packages were missing....

Maybe I made some mistakes, I tried several times...
User avatar
H_Rocky
Posts: 30
Joined: Thu Mar 24, 2016 6:46 pm
Location: Czech Republic
Contact:

Re: Zimbra 10 FOSS Installation Guide

Post by H_Rocky »

I'm building my own builds for RHEL 8 and Ubuntu 20.04. I build both 9.0 and 10. You can try: https://drive.janskolnik.net/s/cyjYjzkHT9nqGgQ
Join the Zimbra community on Telegram: https://t.me/zimbra_community
Post Reply