#! /bin/bash # shellcheck source=../scripts/helper-functions.sh . /usr/local/bin/helper-functions.sh set -o errexit set -o pipefail set -o nounset HOSTNAME=${1} RECIPIENT=${2} SENDER=${3} [[ -x /usr/sbin/pflogsumm ]] || errex "Critical: /usr/sbin/pflogsumm not found" # shellcheck disable=SC2046 BODY=$(gzip -cdfq $(ls -tr /var/log/mail/mail.log*) | /usr/sbin/pflogsumm --problems_first -d yesterday) sendmail -t <