uuencode to MIME email attachment converter?

Hello all, we have an IMAP email system here that basically uses email as the transport for a transaction processing system. Users submit their transaction via an email, and our in-house application pulls the emails from the IMAP server and processes the transaction.

Our problem is that we have some users who are submitting emails with a uuencoded attachment. Our application does not support uuencode, it only supports MIME encoded attachments. Obviously the best solution here is to get those users to fix the mail client on their end. But for political reasons, that's a bit tricky.

My question for the group, is does anyone know of a shell script, perl script, or otherwise, that will accept an email as input, convert any uuencode attachments to MIME attachments, then output the complete email to stdout? I'd like to perform this conversion automatically via a procmail recipe...

It's an odd problem, I know. :wall: