ā This repository runs with the Postal version 2.1.2. It should be fine for version 2.1.x maybe 2.x
The Postal mail delivery platform does not offer encrypted services in the basic installation. That is certificate management, HTTPS interface, mail submission via oportunistic TLS (StartTLS) and implicit TLS. Deploying this repository via Docker Compose will provide these services.
Components of the deployment:
Installed Postal according to the official instructions with working web interface on port 80 and SMTP on port 25. No HTTPS reverse proxy, no certificates management.
/opt/postal
. Edit configuration file /opt/postal/config/postal.yml
adding FQDN of the Postal host (for example postal.example.com
) instead of <HOST>
in the smtp_server section:smtp_server:
port: 25
tls_enabled: true
tls_certificate_path: /caddy-data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/<HOST>/<HOST>.crt
tls_private_key_path: /caddy-data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/<HOST>/<HOST>.key
/opt/caddy-tls
. Change the working directory cd /opt
. Fetch the install repository sudo git clone https://github.com/zdeneksvarc/postal-tls.git
. Jump to the new working directory cd /opt/postal-tls
.env
and Caddyfile
. Also set your e-mail address in the Caddyfile
instead of your@email.com
which is used to identify the owner of the certificate./opt/postal-tls
now run docker compose up https
and wait a while until Caddy gets the certificates. Then exit via CTRL-Csudo ln -s /opt/postal-tls/caddy-data /opt/postal/caddy-data
and set permissions of directory sudo find /opt/postal-tls/caddy-data -type d -exec chmod 755 {} +
and set permissions of files sudo find /opt/postal-tls/caddy-data -type f -exec chmod 644 {} +
/opt/postal/caddy-data:/caddy-data
to the Postal smtp service in /opt/postal/install/docker-compose.yml
.sudo rm /opt/postal/config/Caddyfile
and link a working one sudo ln -s /opt/postal-tls/Caddyfile /opt/postal/config/Caddyfile
and remove .git directory sudo rm -r /opt/postal-tls/.git
and .gitignore file sudo rm -r /opt/postal-tls/.gitignore
postal stop
and start Postal via postal start
, which will now start with StartTLS support on port 25./opt/postal-tls
start the postal-tls Docker Compose project via docker compose up -d
and you're done šopenssl s_client -starttls smtp -connect <host>:<port>
openssl s_client -connect <host>:465
docker compose -p postal logs -f | grep smtp_1
250-STARTTLS
. This is an obvious behavior, since the decrypted communication from port 465 goes to port 25. There are no known issues that this should cause in production.{ key_type rsa4096 }
directive is used in the Caddyfile to force Caddy to use RSA certificates./usr/bin/postal
wrapper.