Why is this rkhunter script sending empty emails?

Posted by Oddthinking on Ask Ubuntu See other posts from Ask Ubuntu or by Oddthinking
Published on 2011-02-28T04:31:17Z Indexed on 2011/02/28 7:32 UTC
Read the original article Hit count: 592

Filed under:
|
|

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?

© Ask Ubuntu or respective owner

Related posts about security

Related posts about shell