How to check, if there is an update for mailcow

Let us assume that mailcow (dockerized) is installed in the directory /opt/mailcow-dockerized, then the script below checks, if there is an update and sends an email to the hostmaster:

#!/bin/bash
set -o nounset
set -o errexit

cd /opt/mailcow-dockerized && ./update.sh --check > /dev/null
exit_code=$?

[ $exit_code -eq 0 ] && echo -e "Subject:MAILCOW: Update available \n\n Update your mailcow instance please!\n" | sendmail hostmaster@your-domain.com
exit 0

The scrip can be run as cron.

  1. Leave a comment

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.