Hi raf, On Fri, May 01, 2020 at 11:20:54AM +1000, raf wrote:
I wrote a tool for replacing non-text attachments in email with text versions. It's at http://raf.org/textmail.
Thank you so much for writting textmail, which is exactly what I needed and much more. It is much cooler than I could ever imagine for a tool like that.
By default, it replaces HTML attachments with inline plain text attachments that contain just the text within the original document. It also reduces text-versus-html alternative attachments to just the text part. It needs lynx to be installed.
If that's the only transformation you want, you'll need to supply lots of options to prevent other default actions. Something like this:
textmail -MWERPULIAVXBS
For the moment, to proccess the few mailboxes I already have (mainly from email lists) that's the only transformation needed (there aren't any images or attached files, just the nasty text/html that doubles (or almost) the size the mailboxes take. In the future, I'll probably be doing other transformations as well for my daily incoming mail.
That suppresses translating and deleting anything else, just HTML.
It works very nicely, thank you, except for 33 messages out of 3336 that result in totaly empty mail (OK), with no content (not even headers).
You can use it in a procmail recipe or apply it to mbox files.
For the moment I'm using a bash for loop, since I have all my mail stored using the Maildir format (one file per message).
WARNING: Please verify it carefully and make sure it's doing what you want before deleting the original mailboxes. Anything that transforms your email should not be trusted until you have reason to trust it.
Sure. The first thing my imapfilter config file has is a recipe to make a copy on a mail folder called bak on the IMAP server, and only then it starts procesing mail. In any case, for this particular case, I'm reading mail from my local original mailbox and writting the output of textmail also into a local testing mailfolder. Until now I haven't done any processing with imapfilter other than some subject line substitutions and mail folder sorting, but I guess it should be possible to use textmail with imapfilter like with procmail, to preprocess email on the IMAP server before fetching it with mbsyn, right? Again thank you so much for such a great tool! Cheers, Ángel