Mailinabox is an awesome tool!! Thanks for making it available!!
A couple of suggestions about cert renewal:
There’s no reason to attempt to renew certs every night, once or twice a week is sufficient. Letsencrypt will allow renewals 30 days ahead of expiration, so renewal attempts once a week would have 3 or 4 opportunities to work on a weekly renewal schedule. The problem with attempting renewal every night, is if it fails - in my case because my DNS servers are external to the box - then I can’t fix it manually myself because Letsencrypt won’t allow more than 5 attempts in a week to renew. So I was blocked from manually fixing the problems myself and and had to disable your nightly attempt for several days.
If a box has DNS configured on external servers, could you NOT attempt cert renewal using DNS?
The easiest way I’ve found to do Letsencrypt renewals without DNS is:
/etc/init.d/nginx stop
certbot-auto certonly -n --standalone -d servername.domainName
/etc/init.d/nginx start
Only takes a couple of seconds to run - downtime is minimal and it works very reliably.