Need help?

Our experts have had an average response time of 11.7 minutes in August 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Secure Zimbra Server with Lets Encrypt Certificate

by | Oct 4, 2021

In this article, we will see how to Secure the Zimbra Server with Lets Encrypt Certificate

As part of our Server Management Services, we assist our customers with several Zimbra queries.

Moving ahead, let us see how our techs perform this.

 

Secure Zimbra Server with Lets Encrypt Certificate

A free, automated, and open certificate authority, the Let’s Encrypt Certificate is used to secure Zimbra Server.

Our Support Techs recommend the following steps to perform the same.

  • Install certbot tool

Suppose we already have Certbot on the server. In that case, we can skip this step.

Otherwise, we run the following commands respectively.

Ubuntu

sudo apt-get update
sudo apt-get install certbot

CentOS 8

sudo yum -y install epel-release
sudo yum -y install certbot

CentOS 7

sudo yum -y install epel-release
sudo yum -y install certbot
  • Stop Zimbra Proxy Service

After that, we go ahead and stop the proxy service.

$ sudo su – zimbra -c “zmproxyctl stop”
Stopping proxy…done.

$ sudo su – zimbra -c “zmmailboxdctl stop”
Stopping mailboxd…done.
  • Obtain Let’s Encrypt SSL Certificate

Now, we have to obtain the certificate.

[[email protected]~]# sudo certbot certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?

1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)

Here, we answer 1 and enter the server hostname.

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/yourhostname.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/yourhostname.com/privkey.pem
Your certificate will expire on 2021-0x-0x. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again. To non-interactively renew *all* of your
certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

We can find all the four files, cert.pem, chain.pem, fullchain.pem and privkey.pem under /etc/letsencrypt/live/yourhostname.com

Next, we edit the chain.pem file and append root CA to it.

Since Let’s Encrypt generate chain.pem file without the root CA, we must use the IdenTrust root Certificate, merge it and append it in the chain.pem.

To get the IdenTrust root Certificate, we go to:

https://letsencrypt.org/certs/trustid-x3-root.pem.txt

We copy the complete text from the above location and paste it under the chain.pem.

  • Verify the certificate

Now we create the directory, /opt/zimbra/ssl/letsencrypt, and copy all the certificate files:

[[email protected] ~]:~# mkdir /opt/zimbra/ssl/letsencrypt
[[email protected] ~]# cp /etc/letsencrypt/live/yourhostname.com/* /opt/zimbra/ssl/letsencrypt/

Then, we change the ownership of files:

[[email protected] ~]:~# # chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/*
[[email protected] ~]# ls -la /opt/zimbra/ssl/letsencrypt/

Once done, we switch to Zimbra user and change the working directory:

[[email protected] ~]:~# su zimbra
[[email protected] ~]$ cd /opt/zimbra/ssl/letsencrypt/

Finally, we verify the certificate:

[[email protected] letsencrypt ~]$/opt/zimbra/bin/zmcertmgr verifycrt comm privkey.pem cert.pem chain.pem

** Verifying 'cert.pem' against 'privkey.pem'
Certificate 'cert.pem' and private key 'privkey.pem' match.
** Verifying 'cert.pem' against 'chain.pem'
Valid certificate chain: cert.pem: OK

An OK message is the end of a successful verification.

  • Deploy Certificate

To finish the SSL installation, we execute the following commands:

[[email protected] letsencrypt~]$ cp /opt/zimbra/ssl/letsencrypt/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key

[[email protected] letsencrypt]$ /opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem chain.pem

Eventually, we restart the Zimbra services to reload the newly installed certificate:

[[email protected] letsencrypt]$ zmcontrol restart

Now, we can see the new SSL certificate in the browser.

  • Test Automatic Renewal

By default, the Certbot packages automatically renew the SSL certificates before expiry.

Unless we change the configuration, we don’t have to execute any command to renew.

However, the below command will simulate the automatic renewal and confirm the working of cron or systemd properly:

[[email protected]~]#sudo certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/yourhostname.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator standalone, Installer None
Account registered.
Simulating renewal of an existing certificate for yourhostname.com
Performing the following challenges:
http-01 challenge for yourhostname.com
Waiting for verification...
Cleaning up challenges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/yourhostname.com/fullchain.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/yourhostname.com/fullchain.pem

[Need help with any of the above steps? We are here for you]

 

Conclusion

In short, we saw how our Support Techs secure Zimbra using Let’s Encrypt Certificate.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF