diff --git a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl index e7e5ba05..01c10381 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl @@ -77,6 +77,12 @@ if command -v postfix > /dev/null; then sudo systemctl enable postfix sudo systemctl restart postfix fi + + if [ -f /etc/aliases ]; then + ### Set the email address to deliver System emails + logg info 'Set the email address to deliver System emails' + sed s/^root.*/root:\ {{ .user.email }}/ -i /etc/aliases && newaliases + fi else logg warn '/etc/postfix is not a directory! Skipping SendGrid Postfix setup.' fi @@ -84,4 +90,4 @@ else logg info 'Skipping Postfix configuration because Postfix is not installed' fi -{{ end -}} \ No newline at end of file +{{ end -}}