2015-12-26 13:39:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script is run daily (at 3am each night).
|
|
|
|
|
2016-02-13 16:51:06 +00:00
|
|
|
# Set character encoding flags to ensure that any non-ASCII
|
|
|
|
# characters don't cause problems. See setup/start.sh and
|
|
|
|
# the management daemon startup script.
|
|
|
|
export LANGUAGE=en_US.UTF-8
|
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
export LANG=en_US.UTF-8
|
|
|
|
export LC_TYPE=en_US.UTF-8
|
|
|
|
|
2021-05-18 11:02:05 +00:00
|
|
|
source /etc/mailinabox.conf
|
|
|
|
|
2018-02-24 14:19:00 +00:00
|
|
|
# On Mondays, i.e. once a week, send the administrator a report of total emails
|
|
|
|
# sent and received so the admin might notice server abuse.
|
|
|
|
if [ `date "+%u"` -eq 1 ]; then
|
2021-11-22 06:05:10 +00:00
|
|
|
management/mail_log.py -t week -r -s -l -g -b | management/email_administrator.py "Mail-in-a-Box Usage Report"
|
2021-04-21 20:42:10 +00:00
|
|
|
|
2021-04-29 20:06:37 +00:00
|
|
|
/usr/sbin/pflogsumm -u 5 -h 5 --problems_first /var/log/mail.log.1 | management/email_administrator.py "Postfix log analysis summary"
|
2018-02-24 14:19:00 +00:00
|
|
|
fi
|
|
|
|
|
2015-12-26 13:39:22 +00:00
|
|
|
# Take a backup.
|
2020-06-07 13:56:45 +00:00
|
|
|
management/backup.py 2>&1 | management/email_administrator.py "Backup Status"
|
2015-12-26 13:39:22 +00:00
|
|
|
|
2015-10-10 22:03:55 +00:00
|
|
|
# Provision any new certificates for new domains or domains with expiring certificates.
|
2021-04-13 07:50:23 +00:00
|
|
|
management/ssl_certificates.py -q 2>&1 | management/email_administrator.py "TLS Certificate Provisioning Result"
|
2015-10-10 22:03:55 +00:00
|
|
|
|
2015-12-26 13:39:22 +00:00
|
|
|
# Run status checks and email the administrator if anything changed.
|
2021-04-13 07:50:23 +00:00
|
|
|
management/status_checks.py --show-changes 2>&1 | management/email_administrator.py "Status Checks Change Notice"
|
2021-05-18 11:02:05 +00:00
|
|
|
|
|
|
|
# Check blacklists
|
|
|
|
tools/check-dnsbl.py $PUBLIC_IP $PUBLIC_IPV6 2>&1 | management/email_administrator.py "Blacklist Check Result"
|