I have an rsync script that runs every night to keep a folder synced with another PC. I need to email someone in my group with the output of the rsync script daily.
So I have the rsync command output to a file, but when I email it, it comes through as an attachment named SUBJECT.dat
But if I mail myself the /etc/fedora-release file I see the contents as the body of the message not an attachment.
So I did the following:
$ file /etc/fedora-release
/etc/fedora-release: ASCII text
$ file rsync.log.12-28-11
rsync.log.12-28-11: ASCII English text, with CR, LF line terminators
This led me to believe that its the encoding that is causing it to show as an attachment. My office email only allows text email, no html or rich text.
Some more info:
I am using Fedora 16 with sendmail.
I use the following command to send the email:
mail -s "Subject" email@example.com < file
So it seems I need to have the rsync script either create the log file as ASCII only on convert it somehow.