Why is this rkhunter script sending empty emails?
- by Oddthinking
I have started running rkhunter (a security monitoring tool) and I have finally managed to clear all of its warnings.
Now, a cron job runs every day to monitor my machine. Rather than send me an email of warnings, it sends me an email with no body - which I don't really want.
Looking at the (unedited, straight out of the box) /etc/cron.daily/rkhunter script, it contains this snippet of shell code:
if [ -s "$OUTFILE" ]; then
(
echo "Subject: [rkhunter] $(hostname -f) - Daily report"
echo "To: $REPORT_EMAIL"
echo ""
cat $OUTFILE
) | /usr/sbin/sendmail $REPORT_EMAIL
fi
The -s clause should prevent empty emails from being sent, right? Does anyone have an explanation why this would still send empty emails?