From 2f41af9cc32b6b9899a49c1d546776a196c3192d Mon Sep 17 00:00:00 2001 From: Honza Hommer Date: Sun, 26 May 2019 07:03:18 +0200 Subject: [PATCH] fix: call _mail_body and _mail_cmnd directly to make sure that all used variables are exposed --- notify/mail.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/notify/mail.sh b/notify/mail.sh index 2705b9f6..0500b2de 100644 --- a/notify/mail.sh +++ b/notify/mail.sh @@ -28,13 +28,11 @@ mail_send() { return 1 fi _MAIL_BIN=$(_mail_bin) - _MAIL_CMND=$(_mail_cmnd) if [ -n "$MAIL_BIN" ]; then _saveaccountconf_mutable MAIL_BIN "$MAIL_BIN" else _clearaccountconf "MAIL_BIN" fi - _MAIL_BODY=$(_mail_body) MAIL_FROM="${MAIL_FROM:-$(_readaccountconf_mutable MAIL_FROM)}" if [ -n "$MAIL_FROM" ]; then @@ -64,7 +62,7 @@ mail_send() { contenttype="text/plain; charset=utf-8" subject="=?UTF-8?B?$(echo "$_subject" | _base64)?=" - result=$({ echo "$_MAIL_BODY" | eval "$_MAIL_CMND"; } 2>&1) + result=$({ _mail_body | _mail_cmnd; } 2>&1) # shellcheck disable=SC2181 if [ $? -ne 0 ]; then