File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2-
3- # Zabbix Email alter shell script
2+ # Zabbix Email alert shell script(**Deprecated**)
43# msmtp is an SMTP client
4+ # TODO(DingGuodong) set a configuration for msmtp
5+ # refer: https://askubuntu.com/questions/1289573/msmtp-sendmail-account-default-not-found-no-configuration-file-available-sys
6+
57DEBUG=1
6- if [[ ${DEBUG} -gt 0 ]]; then
7- exec 2>> /tmp/zabbix_msmtp.log
8- set -x
8+ if [[ ${DEBUG} -gt 0 ]]; then
9+ exec 2>> /tmp/zabbix_msmtp.log
10+ set -x
911fi
1012FROM=' example@example.com'
1113account_name=' zabbix'
@@ -17,10 +19,10 @@ recipient=$1
1719subject=$2
1820message=$3
1921date=$( date --rfc-2822)
20- sed ' s/$/\r/' << eof | /usr/bin/msmtp --account ${account_name} ${recipient}
22+ sed ' s/$/\r/' << eof | /usr/bin/msmtp --account ${account_name} " ${recipient} "
2123From: <${FROM} >
2224To: <${recipient} >
2325Subject: ${subject}
2426Date: ${date}
2527${message}
26- eof
28+ eof
You can’t perform that action at this time.
0 commit comments