diff --git a/etc/icinga2/scripts/mail-host-notification.sh b/etc/icinga2/scripts/mail-host-notification.sh index e75071be1..2a2c011f6 100755 --- a/etc/icinga2/scripts/mail-host-notification.sh +++ b/etc/icinga2/scripts/mail-host-notification.sh @@ -103,7 +103,6 @@ done ## Build the message's subject SUBJECT="[$NOTIFICATIONTYPE] Host $HOSTDISPLAYNAME is $HOSTSTATE!" -ENCODED_SUBJECT="=?utf-8?B?$(base64 --wrap=0 <<< "$SUBJECT")?=" ## Build the notification message NOTIFICATION_MESSAGE=`cat << EOF @@ -158,15 +157,13 @@ if [ -n "$MAILFROM" ] ; then ## Debian/Ubuntu use mailutils which requires `-a` to append the header if [ -f /etc/debian_version ]; then - /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ - | $MAILBIN -a "From: $MAILFROM" -s "$ENCODED_SUBJECT" $USEREMAIL + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL ## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r` else - /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ - | $MAILBIN -r "$MAILFROM" -s "$ENCODED_SUBJECT" $USEREMAIL + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL fi else - /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ - | $MAILBIN -s "$ENCODED_SUBJECT" $USEREMAIL + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" \ + | $MAILBIN -s "$SUBJECT" $USEREMAIL fi diff --git a/etc/icinga2/scripts/mail-service-notification.sh b/etc/icinga2/scripts/mail-service-notification.sh index eca5def07..c901f234d 100755 --- a/etc/icinga2/scripts/mail-service-notification.sh +++ b/etc/icinga2/scripts/mail-service-notification.sh @@ -107,7 +107,6 @@ done ## Build the message's subject SUBJECT="[$NOTIFICATIONTYPE] $SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICESTATE!" -ENCODED_SUBJECT="=?utf-8?B?$(base64 --wrap=0 <<< "$SUBJECT")?=" ## Build the notification message NOTIFICATION_MESSAGE=`cat << EOF @@ -163,15 +162,13 @@ if [ -n "$MAILFROM" ] ; then ## Debian/Ubuntu use mailutils which requires `-a` to append the header if [ -f /etc/debian_version ]; then - /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ - | $MAILBIN -a "From: $MAILFROM" -s "$ENCODED_SUBJECT" $USEREMAIL + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL ## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r` else - /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ - | $MAILBIN -r "$MAILFROM" -s "$ENCODED_SUBJECT" $USEREMAIL + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL fi else - /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ - | $MAILBIN -s "$ENCODED_SUBJECT" $USEREMAIL + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" \ + | $MAILBIN -s "$SUBJECT" $USEREMAIL fi