I wrote this for myself, but it’s useful for anyone. It relies on ntfy.sh’s service which can send push notifications to your phone. Once you have that set up, put quickstatus.sh in /usr/local/bin, chmod it to 700, and create a cron job for it to run every 10 minutes. If it detects a service down, it’ll iterate through the number of retries you specify and then alert you if it wasn’t a false positive (which Dovecot seems to be prone to specifically).
I hope it’s useful to somebody other than myself