Procházet zdrojové kódy

Merge pull request #1073 from jakubsuchybio/master

Add variable to set email's sender 'emailfrom'
Daniel Gibbs před 9 roky
rodič
revize
37da5db388

+ 1 - 0
CounterStrikeGlobalOffensive/csgoserver

@@ -19,6 +19,7 @@ version="210516"
 # Email
 emailalert="off"
 email="email@example.com"
+#emailfrom="email@example.com"
 
 # Pushbullet
 # https://www.pushbullet.com/#settings

+ 5 - 1
lgsm/functions/alert_email.sh

@@ -230,7 +230,11 @@ fn_details_performance
 fn_details_disk
 fn_details_gameserver
 fn_alert_email_template_logs
-mail -s "${alertsubject}" "${email}" < "${emaillog}"
+if [ -n "${emailfrom}" ]; then
+	mail -s "${alertsubject}" -a "From: ${emailfrom}" "${email}" < "${emaillog}"
+else
+	mail -s "${alertsubject}" "${email}" < "${emaillog}"
+fi
 exitcode=$?
 if [ "${exitcode}" == "0" ]; then
 	fn_print_ok_nl "Sending alert: ${email}"