What is the MIME equivalent of uuencode for sendmail?

You need mimencode from the metamail package... Debian has some package info, but the package is based on ancient Bellcore code.

If you're just trying to send mail though, you might look into using mutt; I think it can mimencode attachments from the commandline.


The best luck I had was with mime-construct, written in Perl. It does pretty much everything uuencode does, and is pipeable, which is what I needed. (No, I was not looking for an MTA such as mutt... msmtp is all I need, thank you very much.)

For people interested, you call it using something like

$mime-construct --output --to "[email protected]" --file-attach "a.jpg"

which prints a load of random gobbledygook to stdout, just as uuencode would if you didn't pipe it somewhere else.