Installare Carbonio Mailserver su Ubuntu 20.04

Gennaio 11, 2022 By luca@studiomondello.eu

Preparare il sistema

sudo hostnamectl set-hostname mailserver.dominio.it

echo "192.168.1.235 mailserver.dominio.it mailserver" >> /etc/hosts

echo 'deb https://repo.zextras.io/release/ubuntu focal main' >>/etc/apt/sources.list.d/zextras.list

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 52FD40243E584A21

apt update && apt upgrade

Installazione Carbonio

apt install service-discover-server \ carbonio-directory-server \ carbonio-proxy \ carbonio-webui carbonio-files-ui \ carbonio-admin-login-ui \ carbonio-mta \ carbonio-appserver carbonio-logger \ carbonio-user-management \ carbonio-files-ce carbonio-files-db \ carbonio-storages-ce \ carbonio-preview-ce \ carbonio-docs-connector-ce carbonio-docs-editor \ postgresql-12

carbonio-bootstrap

service-discover setup-wizard

pending-setups

usermod -a -G carbonio-mailbox zextras

chmod 0666 /etc/zextras/carbonio-mailbox/token

su - postgres -c "psql --command=\"CREATE ROLE carbonio_adm WITH LOGIN SUPERUSER encrypted password 'DB_ADM_PWD';\""

su - postgres -c "psql --command=\"CREATE DATABASE carbonio_adm owner carbonio_adm;\""

PGPASSWORD=DB_ADM_PWD carbonio-files-db-bootstrap carbonio_adm 127.0.0.1

su - zextras

zmmailboxdctl restart

zmprov setpassword zextras@dominio.it PASSWORD

Installare Certbot

snap install core; sudo snap refresh core

apt-get remove certbot

snap install --classic certbot

ln -s /snap/bin/certbot /usr/bin/certbot

certbot renew --dry-run

Creazione certificato

certbot certonly --standalone -d mailserver.dominio.it --preferred-chain "ISRG Root X1"

Installazione certificato

su zextras

zmcontrol stop

exit

cp /etc/letsencrypt/live/mailserver.dominio.it/privkey.pem /opt/zextras/ssl/carbonio/commercial/commercial.key

chown zextras:zextras /opt/zextras/ssl/carbonio/commercial/commercial.key

wget -O /tmp/ISRG-X1.pem https://letsencrypt.org/certs/isrgrootx1.pem.txt

cat /tmp/ISRG-X1.pem >> /etc/letsencrypt/live/mailserver.dominio.it/chain.pem

mkdir /opt/zextras/ssl/letsencrypt

cp /etc/letsencrypt/live/mailserver.dominio.it/* /opt/zextras/ssl/letsencrypt/

chown zextras:zextras /opt/zextras/ssl/letsencrypt/*

su zextras

cd /opt/zextras/ssl/letsencrypt/

/opt/zextras/bin/zmcertmgr verifycrt comm privkey.pem cert.pem chain.pem

/opt/zextras/bin/zmcertmgr deploycrt comm cert.pem chain.pem

zmcontrol start

Interfaccia

https://mailserver.dominio.it/

https://mailserver.dominio.it:6071/login

apt install carbonio-ce

carbonio-bootstrap

su - zextras

zmprov setpassword zextras@dominio.it PASSWORD

Installare Certbot

snap install core; sudo snap refresh core

apt-get remove certbot

snap install --classic certbot

ln -s /snap/bin/certbot /usr/bin/certbot

certbot renew --dry-run

Creazione certificato

certbot certonly --standalone -d mailserver.dominio.it --preferred-chain "ISRG Root X1"

Installazione certificato

su zextras

zmcontrol stop

exit

mkdir /opt/zimbra/ssl/zimbra/commercial

mkdir /opt/certificato/commercial

cp /etc/letsencrypt/live/mailserver.dominio.it/privkey.pem
/opt/zextras/ssl/carbonio/commercial/commercial.key

chown zextras:zextras /opt/zextras/ssl/carbonio/commercial/commercial.key

wget -O /tmp/ISRG-X1.pem https://letsencrypt.org/certs/isrgrootx1.pem.txt

cat /tmp/ISRG-X1.pem >> /etc/letsencrypt/live/mailserver.dominio.it/chain.pem

mkdir /opt/certificato/letsencrypt

cp /etc/letsencrypt/live/mailserver.dominio.it/* /opt/certificato/letsencrypt/

chown zextras:zextras /opt/certificato/letsencrypt/*

su zextras

cd /opt/certificato/letsencrypt

/opt/zextras/bin/zmcertmgr verifycrt comm privkey.pem cert.pem chain.pem

/opt/zextras/bin/zmcertmgr deploycrt comm cert.pem chain.pem

zmcontrol start

Interfaccia

https://mailserver.dominio.it/

https://mailserver.dominio.it:7071/carbonioAdmin