Replace certificate
- Copy the new certificate files as
tls.crt(certificate) andtls.key(private key) into the folder/etc/xorlab/tls. - Execute the following commands to set the permission and ownership. The files need to be readable by user
ag_mta(uid: 2020, gid: 2020):Then it should look like this: - Restart the MTA containers. This will lead to a 1-2 minute downtime, where the MTA does not accept emails:
- Go to the folder
/var/log/xorlab/activeguard/mta/and check in the filesmail.warnandmail.errthat there are no errors related to the TLS certificates.
(Optional) Initial setup for older VMs
For older xorlab VMs, it may be required to reconfigure xorlab the first time before you can use the above procedure to replace certificates.Change the docker config
In/etc/xorlab/activeguard/docker-compose.yml add a bind mount to the mta service to map the folder on the host containing the certificates files to the mta container. You are free to choose any path inside the container, however, do not choose /etc/ssl/my_certs as this directory will be overwritten by the internal config service. In this example, we will use /etc/ssl/custom/:
/etc/xorlab/activeguard/.env set the $TLS_CERT_DIR variable:
Change the postfix config
- In the XCC Expert Editor, open the
main.cffile located inactiveguard/mta/startup_cfg/postfix_custom/. - Set
smtpd_tls_cert_fileandsmtpd_tls_key_fileparameters based on the chosen path above, in this case/etc/ssl/custom/: - Click Publish and add a comment to these edits, for example,
Add custom TLS certificates.