I had the same problem sometimes ago, and I found no simple solutions using sendmail. So I used the
uudeview decoder/encoder (look for the RPM) in the following way (inside a script):
Code:
email="pippo@anydomain.it"
subject="test mail with attachment"
reply="pluto@anydomain.it"
from="pluto@anydomain.it"
uuenview -m $email -f "$from" -r "$reply" -s "$subject" -a $file.tar.gz << EOF
Greetins,
any text here
(see attach file.tar.gz)
EOF
In this case the file.tar.gz will be properly encoded, attached to the mail and sent succesfully!
