I have a cron job that generates text files. I'd like these files to be sent as attachments to an email address. It's important that they show up as attachments in a multi-part MIME message and not just as text in the body of the email.
I have read about sendmail and the MAILTO parameter in /etc/crontab, but I am not able to write a simple example to build off of.
I do not have mutt, mail, or mailx installed on my server.
You could give nail a try. It allows you to specify an attachment.
In your script that generates these files you'd do something like the snippet below to deliver the file as an attachment to an email.
the upstream for cron is here:
https://github.com/vixie/cron
i'd welcome patches to implement MIME for the stream i pipe into the "sendmail" wrapper. i'm already sending some headers, it would be a small matter to add the MIME headers and also close out the MIME attachment at EOF. there may be some hair involved if we have to "escape" the MIME markers that may appear inside the command's output, but i think that won't be necessary.
how to get your distro (or any distro) who imported cron ~20 years ago to merge against the upstream is a separate and much more difficult problem.