apcupsd email should be properly threaded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apcupsd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: apcupsd
Acupsd is a really nice package, so this is just a suggestion for a small improvement. By default, acupsd emails me (i.e. system admin) on power outage, and when power returns. However, these emails have different subjects, and thus tend to get threaded separately, while ideally, events belonging together should thread together.
The easiest solution is through the scripts (/etc/acupsd/
==> /etc/apcupsd/
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/
# UPS goes back on to the mains after a power failure.
# We send an email message to root to notify him.
#
SYSADMIN=root
APCUPSD_MAIL="mail"
HOSTNAME=`hostname`
MSG="$HOSTNAME Power has returned"
if test -f /var/lib/
fi
#
(
echo "Subject: $MSG"
echo " "
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -a "In-Reply-To: $LASTEVENT" -s "$MSG" $SYSADMIN
exit 0
==> /etc/apcupsd/
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/
# goes on batteries.
# We send an email message to root to notify him.
#
SYSADMIN=root
APCUPSD_MAIL="mail"
HOSTNAME=`hostname`
MSG="$HOSTNAME Power Failure !!!"
MSGID="<"`date +%H%M%S`
echo $MSGID > /var/lib/
#
(
echo "Subject: $MSG"
echo " "
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -a "Message-Id: $MSGID" -s "$MSG" $SYSADMIN
summary: |
- acupsd email should be properly threaded + apcupsd email should be properly threaded |
One more thing, what's with the "echo $MSG"'s? Is it for broken mailers that add no headers on their own? But mail is called with -s option later on...