From b4c0035e28cdb8f69e95ca00f0b4d369137e7d58 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sat, 2 Jun 2018 01:57:39 +0530 Subject: [PATCH] Do not use /usr/bin/mail --- scripts/_common.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 409055a..5cea137 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -56,7 +56,15 @@ $app_message --- 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" }