From c3c534f7ce6f293a4d643595b1fd6349abf82534 Mon Sep 17 00:00:00 2001 From: Matthias Johnson Date: Sat, 14 Feb 2026 15:51:31 -0700 Subject: [PATCH] Auto-detect sendmail/msmtp for email notifications Resolve the mailer binary at job creation time and bake the full path into the service file, so it works regardless of PATH in the systemd service environment. Warns and skips if neither is found. Co-Authored-By: Claude Opus 4.6 --- systab | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/systab b/systab index 394ba9c..2a39c88 100755 --- a/systab +++ b/systab @@ -283,8 +283,11 @@ ExecStopPost=/bin/sh -c 'if [ "\$SERVICE_RESULT" = success ]; then icon=dialog-i EOF fi if [[ -n "$email" ]]; then + local mailer + mailer=$(command -v sendmail || command -v msmtp || true) + [[ -n "$mailer" ]] || { warn "No sendmail or msmtp found, skipping email notification"; return; } cat >> "$file" <