Skip to content

Postfix is not reloaded when certificate files are updated

I am using a bit unconventional setup for certificates in my SNM installation, where Caddy manages all of the certificates.

mailserver = on // {
    inherit fqdn;
    domains = [ fqdn "cab404.ru" ];
    certificateScheme = "manual";
    certificateFile = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${fqdn}/${fqdn}.crt";
    keyFile = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${fqdn}/${fqdn}.key";

It worked like a charm, and I forgot about it for some time until suddenly it stopped working. Neither Thunderbird nor K-Mail did not show any error message — they've just refused to connect — so I had a relaxing week-long period of not reading my emails :)

Turned out that Postfix did not reload certificate from file when it changed, and continued to use an old one.

So I guess some Path units on certificates, and autoreload postfix on them should do the trick?

Edited by Cabia Rangris