From 95894abe03c309404905a86d5d6babf25ae2b283 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 28 Apr 2018 17:16:08 +0200 Subject: [PATCH] Do not use /usr/bin/mail https://github.com/YunoHost-Apps/Experimental_helpers/commit/743cfc4b00161d76347683554c24cf21003d16d3 --- scripts/_common.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 142d9e8..b23810b 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -210,6 +210,14 @@ Automatic diagnosis data from YunoHost $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" + # Define binary to use for mail command + if [ -e /usr/bin/bsd-mailx ] + then + local mail_bin=/usr/bin/bsd-mailx + else + local mail_bin=/usr/bin/mail.mailutils + fi + # Send the email to the recipients - echo "$mail_message" | mail -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" + echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" }