From 6b63e0a8ded3d7b70f6d97c6438768a631719e57 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Wed, 19 Apr 2023 13:31:45 +0000 Subject: [PATCH] Update 2 files - /home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl - /home/dot_config/postfix/com.apple.postfix.master.plist --- .../run_onchange_after_05-postfix.sh.tmpl | 15 ++++++++--- .../postfix/com.apple.postfix.master.plist | 26 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 home/dot_config/postfix/com.apple.postfix.master.plist 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 1a9870a2..2dd242a3 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl @@ -60,10 +60,17 @@ if command -v postfix > /dev/null; then sudo postmap /etc/postfix/sasl_passwd fi - ### Enable / restart postfix - logg info 'Enabling / restarting postfix' - sudo systemctl enable postfix - sudo systemctl restart postfix + if [ -d /Applications ] && [ -d /System ]; then + ### macOS + # Source: https://budiirawan.com/install-mail-server-mac-osx/ + sudo postfix start + sudo postfix reload + else + ### Enable / restart postfix on Linux + logg info 'Enabling / restarting postfix' + sudo systemctl enable postfix + sudo systemctl restart postfix + fi else logg warn '/etc/postfix is not a directory! Skipping SendGrid Postfix setup.' fi diff --git a/home/dot_config/postfix/com.apple.postfix.master.plist b/home/dot_config/postfix/com.apple.postfix.master.plist new file mode 100644 index 00000000..762fe605 --- /dev/null +++ b/home/dot_config/postfix/com.apple.postfix.master.plist @@ -0,0 +1,26 @@ + + + + + Label + com.apple.postfix.master + Program + /usr/libexec/postfix/master + ProgramArguments + + master + -e + 60 + + QueueDirectories + + /var/spool/postfix/maildrop + + AbandonProcessGroup + + RunAtLoad + + KeepAlive + + + \ No newline at end of file