From 01c62aa4ca7a0817a1d9686579c7893b5397d1e6 Mon Sep 17 00:00:00 2001 From: deajan Date: Thu, 1 Dec 2016 21:27:28 +0100 Subject: [PATCH] Multiple recipient compat for mutt --- dev/ofunctions.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index b5064d0..f5f9e36 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,6 +1,6 @@ #### MINIMAL-FUNCTION-SET BEGIN #### -## FUNC_BUILD=2016120101 +## FUNC_BUILD=2016120102 ## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## To use in a program, define the following variables: @@ -410,7 +410,8 @@ function SendEmail { fi if type mutt > /dev/null 2>&1 ; then - echo "$message" | $(type -p mutt) -x -s "$subject" "$destinationMails" $attachment_command + # We need to replace spaces with comma in order for mutt to be able to process multiple destinations + echo "$message" | $(type -p mutt) -x -s "$subject" "${destinationMails// /,}" $attachment_command if [ $? != 0 ]; then Logger "Cannot send mail via $(type -p mutt) !!!" "WARN" else @@ -1357,15 +1358,13 @@ function __CheckArguments { IFS='-' read minArgs maxArgs <<< "$numberOfArguments" fi - if [ "$_PARANOIA_DEBUG" == "yes" ]; then - Logger "Entering function [$functionName]." "DEBUG" - fi + Logger "Entering function [$functionName]." "PARANOIA_DEBUG" if ! ([ $countedArguments -ge $minArgs ] && [ $countedArguments -le $maxArgs ]); then Logger "Function $functionName may have inconsistent number of arguments. Expected min: $minArgs, max: $maxArgs, count: $countedArguments, bash seen: $numberOfGivenArguments. see log file." "ERROR" Logger "Arguments passed: $argList" "ERROR" else - Logger "Arguments passed: $argList" "VERBOSE" + Logger "Arguments passed: $argList" "PARANOIA_DEBUG" fi fi }