From 85d25d67599945ac7c8901f7c3e06ada78af2951 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sun, 1 Oct 2023 14:46:43 +0100 Subject: [PATCH] Update mail.conf and warn-git-status for different mailx. --- etc/cron.daily/warn-git-status | 2 +- etc/mail.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/cron.daily/warn-git-status b/etc/cron.daily/warn-git-status index d274574..7645bea 100755 --- a/etc/cron.daily/warn-git-status +++ b/etc/cron.daily/warn-git-status @@ -6,4 +6,4 @@ CONFIGSTATUS="$(cd / && git status | egrep -ve "^(On branch|Your branch|No commi [[ -z "$CONFIGSTATUS" ]] && exit 0 -mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "git statuses" "${EMAIL_TO[@]}" <<<"$CONFIGSTATUS" +mailx "${MAILX_ARGS[@]}" -S from="$EMAIL_FROM" -s "git statuses" "${EMAIL_TO[@]}" <<<"$CONFIGSTATUS" diff --git a/etc/mail.conf b/etc/mail.conf index 28e24e6..fdabe64 100644 --- a/etc/mail.conf +++ b/etc/mail.conf @@ -1,6 +1,6 @@ # This file is sourced by various scripts that need to send emails. -case "$(hostname -d)" in +case "${HOSTNAME#*.}" in afterdark.lan) EMAIL_DOMAIN="afterdark.org.uk" ;; @@ -10,7 +10,7 @@ case "$(hostname -d)" in esac EMAIL_FROM="${HOSTNAME%%.*} " -EMAIL_TO=("Systems Administrator ") +EMAIL_TO=("sysadmin@$EMAIL_DOMAIN") case "$1" in sbosrcarch)