I love that Kumo is so stable that I don’t have to restart unless I do an upgrade, but I’m using Let’s Encrypt to get the certs, which means that I’ll have to restart Kumo at least once every three months to make sure it doesn’t continue using the same certificate after it has expired. Would be great if there was an option to tell Kumo to reload the certificate every 24 hours - or if it’d automatically reload the certificate periodically itself without having to tell it in the config.
It is technically possible to make the certs reload without a restart of the whole listener, but it needs a bit of engineering effort. I think there’s also a story around handling integrated let’s encrypt processing here too via HTTP and/or DNS challenges, as well as just reloading when the files change on disk, so I would consider both together when sitting down to design this.
that’s a bigger sort of change than I had in mind. Due to limitations in the lua bindings, we cannot directly reference functions in the way that’s sketched out there, we’d need to use kumo.on to set up the event handling.
What I was thinking was honestly a bit simpler: periodically check the mtime of the certs when the KeySource (the cert and key parameters are KeySource objects: object: keysource - KumoMTA Docs) is a local file.
That could be expanded to work more like the dkim signer type, that is essentially a key source + ttl.
Having a callback function seems powerful, but I don’t know how many folks will actually use it, as they’re most likely dealing with regular files on disk for this stuff.
Yeah, it’s probably overkill here. I actually would prefer it to be automatic based on mtime like you described.
What I wrote above - or better yet, a kumo.on event as you mentioned - might make sense for situations where the MTA is being used for multiple domains on the same port, thinking of what Office365 / Google Workspace do, where the customer can access SMTP on customer-domain.com:587. The callback method could allow the system to provide a separate cert based on the domain (if the domain is passed to the func as a parameter). but that’s not what I’m doing anyway.
Just wanted to bump this - had an incident last night with expired certs again, our monitoring systems caught it and I quickly fixed it by restarting kumo. I could write a cron job to restart kumo every 30 days, but for some reason kumo almost always takes longer than 5 minutes to shutdown and get killed (SIGKILL) by systemd in the end, so that would mean at least a 5 minute downtime every 30 days.
Well usually let’s encrypt will update certs really in time… so if you would restart kumomta once a week you should be serted?
And if you wanna make it real fancy: a check script to find all end_dates of certificates which can be used to calculate when certificates will need updating. To then restart kumomta only when it is really needed.
But in production with tons of certificates for clients it will restart more frequently then probably, so a weekly restart of Kumo would then still be the easiest option.
Oh and if you have more then one Kumomta running restart them on different times and use load-balancing to keep the SMTP flow going.
Shutdown could take longer than the 300s permitted by kumomta.service when lua delivery handlers are experiencing delays, leading to systemd issuing a SIGKILL.