Can you decipher the word MAICLX?

Linux - Scriptable Email Client?

If you really need to create a script, most of today's high-level scripting languages ​​(e.g. Python, Ruby) have excellent email management libraries. It's pretty easy to put something together that will feed you parts of a message.

If you're doing text to speech, I'm not sure what you need MIME decoding for. MIME is usually only used to attach binary attachments. When you store messages in a Maildir format message store, you already have one message per file, so you really don't have that much work to do if you just want to read (a) just the message headers and (b) the first part of the body.

The email utilities may be useful for scripting support if you choose this route. The package is available on CentOS and Ubuntu, I believe. More information here.

I think emacs is good for both eyeless use and email content and they work well together. It is scriptable provided you are willing to learn elisp.

Any major scripting language that supports nested data structures should have libraries to parse mailboxes or speak IMAP and work with MIME email. Shell doesn't count and if you try you have left the area where shell scripts can be managed. Try Python / Perl / Ruby instead.

Python includes the package that brings many functions together in one place: http://docs.python.org/library/email plus and for your storage needs.