ssmtp sends as email attachment instead of body text
Hello,
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: Code:
#!/bin/sh 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 Code:
[rkhunter outpu] | iconv -c -t UTF-8 | /bin/mail -v -s 'rkhunter daily run' myemail@gmail.com /etc/environment has locale set to en_US I tried setting locale within the scrip like this : Code:
LOC="en_US" Code:
echo 'some text' | /bin/mail -v -s 'UTF Test' myemail@gmail.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit while the output from rkhunter shows this when sent: Content-Type: application/octet-stream Content-Transfer-Encoding: base64 |
Ok, a little unstuck now. Putting this up if it helps anyone else. I'm not sure if this is the right way to solve this but it works for now.
Changing the script to this works now Code:
# send rkhunter output to a file Code:
To: myemail@gmail.com Code:
cat /var/log/rkhuntercron.log | mail -v -s 'rkhunter mail test' myemail@gmail.com Code:
[<-] 220 mx.google.com ESMTP xxxxxxxxxxxxx.xx - gsmtp |
All times are GMT -5. The time now is 08:06 PM. |