Filter script to remove html, fullquotes and header lines

Martin Trautmann traut at gmx.de
Tue Mar 22 06:31:44 UTC 2022


Am 2022-03-22 um 01:56 schrieb raf:
> On Mon, Mar 21, 2022 at 01:28:28PM +0100, Martin Trautmann <traut at gmx.de> wrote:
>
>> Am 2022-03-21 um 12:56 schrieb raf:
>>> textmail can probably do at least some of what you want:
>>>
>>>     https://raf.org/textmail
>>>     https://github.com/raforg/textmail
>>>
>>> and it has some extensibility so you can supply external
>>> translation programs for the bits it doesn't do.
>>>
>>> it can operate on individual mail messages or mbox files.
>>> check the output carefully. :-)
>> Thanks, that looks very helpful to strip attachments, to remove headers
>> and to convert message bodies - but it lacks the option to perform a
>> search and replace on message bodies!?
> The -C option lets you supply a custom external
> "attachment translation" program. That might help.
> Something like "-C text/plain:txt:cmd". You just need
> to write the "cmd" program in the language of your
> choosing. If it doesn't work, you could modify textmail
> to do what you need (rather than writing the whole
> thing) if you like perl.

Thanks, I didn't expect it there.

I guss some simple sed commands would be good enough here.
> If you try it and run into problems, let me know (off list)
> and we can probably get it to work.
Would I still need mutt to do the mails one by one and pipe them to
testmail?
I expected testmail to work on full mbox files, but it handled the first
mail only.



More information about the Mutt-users mailing list