I would really appreciate any help with this as I'm thoroughly stuck.
I've set up rkhunter to run as a cron job and then email any warnings etc using ssmtp via gmail with this script:
/usr/local/bin/rkhunter --cronjob --report-warnings-only
) | /bin/mail -v -s 'rkhunter daily run' email@example.com
It all works ok, except that it sends the output as an attachment rather in the body.
It happens whether it is run via cron or within a normal shell.
I found a similar problem relating to encoding and tried piping it like this
[rkhunter outpu] | iconv -c -t UTF-8 | /bin/mail -v -s 'rkhunter daily run' firstname.lastname@example.org
but that didn't fix it either
/etc/environment has locale set to en_US
I tried setting locale within the scrip like this :
This sends text as the body in an email like you would expect:
echo 'some text' | /bin/mail -v -s 'UTF Test' email@example.com
and displays :
Content-Type: text/plain; charset=us-ascii
while the output from rkhunter shows this when sent: