how to check size of zimbra mail accounts from terminal

The most easy way to see the size of all zimbra mailboxes is to ssh into your zimbra server and type the following: $ su – zimbra $ all_accounts=zmprov -l gaa; for account in $all_accounts; do mbox_size=zmmailbox -z -m $account gms; echo “Mailbox size of $account = $mbox_size”; done ;

composer update: mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory

proc_open(): fork failed errors# If composer shows proc_open() fork failed on some commands: PHP Fatal error: Uncaught exception ‘ErrorException’ with message ‘proc_open(): fork failed – Cannot allocate memory’ in phar This could be happening because the VPS runs out of memory and has no Swap space enabled. To enable the swap you can use for… Continue reading composer update: mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory

npm to add sb-admin-2 to laravel

First of all make sure you have node.js installed. If you haven’t so, install it: https://nodejs.org/en/ Change directory to your laravel project and use npm to install sb-admin-2 like this: npm install –global startbootstrap-sb-admin-2 If it compains for popper or other packages, use npm again to install them, like this: npm install –global popper Now,… Continue reading npm to add sb-admin-2 to laravel

existing code to bitbucket

Let’s assume you ‘ve got setup a small project locally and it’s time to add it to bitbucket. All you need to know is: https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html There are a couple of details though that could make your life difficult if you don’t pay the proper attention: Locally: Bitbucket: create a repo (but pay attention!) without adding… Continue reading existing code to bitbucket

How to merge two zimbra mailboxes

If you want to merge 2 zimbra mailboxes, you can simply export the source mailbox and import it to the target mailbox. This can be easilly achieved with a couple of zimbra commands. SSH into your zimbra server. Change to zimbra server:su – zimbra Now type:/opt/zimbra/bin/zmmailbox -z -m [email protected] getRestURL “//?fmt=tgz” > /tmp/temp.tgz && /opt/zimbra/bin/zmmailbox… Continue reading How to merge two zimbra mailboxes

xampp + php + curl + ssl = fatal_error

If you use xampp with php and curl you might encounter an error like this: Fatal error: Uncaught exception ‘HttpClientException’ with message ‘cURL Error: SSL certificate problem: unable to get local issuer certificate’ in HttpClient.php If this is the case the solution is easy: Download cacert.pem from official curl page https://curl.haxx.se/docs/caextract.html Copy cacert.pem to c:\xampp\cacert.pem… Continue reading xampp + php + curl + ssl = fatal_error

zimbra: multiple letsencrypt certificates and Unable to start TLS error

The following guide is tested against zimbra 8.8: Installing a Let’s Encrypt SSL Certificate

If this error occurs: ‘Unable to start TLS: hostname verification failed when connecting to ldap master.
make sure you have included your hostname in your letsencrypt signing domains and follow the guide once again.
For instance, if your hostname is mail5.example.com, use letsencrypt to sign mail5.example.com along with all other domains.

Example:

[email protected]:~/tmp/letsencrypt# ./letsencrypt-auto certonly --standalone -d mail5.example.com -d mail.example.com -d webmail.example.com -d mail.test.com -d webmail.test.com

Make also sure you append https://www.identrust.com/certificates/trustid/root-download-x3.html to chain.pem

The whole procedure seems a bit tricky but actually it’s easy and it works.

Hopefully, some clever people have developed a bunch of scripts to automate the whole procedure, not all of them work in all cases. We have successfully tested the first automated method (https://github.com/VojtechMyslivec/letsencrypt-zimbra/) and it works great, as long as you keep incuding hostname in your config to avoid the “Unable to start TLS” error.

So open up your config at:

/opt/letsencrypt-zimbra/letsencrypt-zimbra.cfg

And edit the line with common names:


common_names=( "mail5.example.com" "mail.example.com" "webmail.example.com" "mail.test.com" "webmail.test.com" )

 

Automated method installation instructions are very simple – just follow them here: https://github.com/VojtechMyslivec/letsencrypt-zimbra/

The manual method, although hasn’t any real difficulties, has some steps though that might prove a nightmare when it comes to renew certs every 3 months for letsencrypt certs. Anyhow, for all of you manual people, steps are the following:

  • Stop zimbra services: zmcontrol stop
  • Use letsencrypt to fetch the certificates: ./letsencrypt-auto certonly --standalone -d mail5.example.com -d mail.example.com -d webmail.example.com -d mail.test.com -d webmail.test.com. If asked, select expand (E).
  • Append missing certificate to chain.pem
  • Copy created certificates to zimbra location: cp /etc/letsencrypt/live/mail5.example.com/* /opt/zimbra/ssl/letsencrypt/
  • Set rights: chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/*
  • Login as zimbra: su - zimbra
  • Goto certificates path: cd /opt/zimbra/ssl/letsencrypt
  • Check certificate validity: /opt/zimbra/bin/zmcertmgr verifycrt comm privkey.pem cert.pem chain.pem
  • Take a backup: cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d")
  • Deploy certificates to zimbra installation: /opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem chain.pem
  • Restart zimbra: zmcontrol restart