From 7cb987a32bd54fd948f6208d128948e7b9773450 Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 2 Jul 2018 22:09:28 +0200 Subject: [PATCH] More email checks --- dev/ofunctions.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index b77e478..d042ead 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -8,7 +8,7 @@ #### OFUNCTIONS FULL SUBSET #### #### OFUNCTIONS MINI SUBSET #### _OFUNCTIONS_VERSION=2.3.0-dev -_OFUNCTIONS_BUILD=2018070201 +_OFUNCTIONS_BUILD=2018070202 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -503,11 +503,16 @@ function SendEmail { local i - for i in "${destinationMails}"; do - if [ $(CheckRFC822 "$i") -ne 1 ]; then - Logger "Given email [$i] does not seem to be valid." "WARN" - fi - done + if [ "${destinationMails[@]}" != "" ]; then + for i in "${destinationMails[@]}"; do + if [ $(CheckRFC822 "$i") -ne 1 ]; then + Logger "Given email [$i] does not seem to be valid." "WARN" + fi + done + else + Logger "No valid email adresses given." "WARN" + return 1 + fi # Prior to sending an email, convert its body if needed if [ "$MAIL_BODY_CHARSET" != "" ]; then