Prerequisites
Postfix requires a certificate and a key as two separate files in PEM format. Please see postfix TLS config. You will need SSH access to all MTA machines and sudo / root privileges. Four steps are required to use the custom TLS certificates.Copying certificates to the MTAs
Save your custom certificate files on each MTA in a dedicated folder astls.crt (certificate) and tls.key (private key). The recommended path is /etc/xorlab/tls. The files must be readable by user ag_mta (uid: 2020, gid: 2020). It is recommended that the private key is readable by this user only.
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 to deploy changes and add a comment to these edits, for example,
Add custom TLS certificates.
Restart postfix container
In order for the config changes to take effect, you need to restart the postfix container,ag_mta. For inline setups, it is recommended to stop the core scan sources first and wait for all emails to be processed as the emails will be moved to the Erroneous queue if the scan finishes while postfix is not running. For bcc setups, this is no concern as no emails are sent back from xorlab Security Platform core to postfix. The following commands stop postfix and restart the ag_mta container. Make sure to be in the /etc/xorlab/activeguard/ path when executing the Docker commands.
-
Restart the
ag_mtacontainer: -
Check in the
mail.warnandmail.errlogs that there are no errors related to the TLS certificates.