Konstantin Ryabitsev <konstan...@linuxfoundation.org> wrote:
> Hello:
> 
> Groups.io adds a super-obnoxious footer to all outgoing messages, and I 
> would like to be able to filter that out. Example:
> 
> https://lore.kernel.org/keys/20191111161300.hc7vb7rcb45gsqmg@chatter.i7.local/
> 
> The obnoxious footer can be either part of the main body (default
> "chaotic evil" version) or a separate mime-part (configurable, "lawful 
> evil").
> 
> I tried to wrap my brain around existing filters, but they don't quite 
> do the exact thing I need, specifically:
> 
> - if there is a text/plain mime-part with just "^-=-=.*=-=-$", remove it
> - if there is no more content left after removing the footer, nuke the 
>   entire mime-part
> 
> Any quick pointers how this can be accomplished? 

Maybe check the call to ->walk_parts and ->body_str_set in
lib/PublicInbox/Filter/RubyLang.pm.

Also, historical versions of lib/PublicInbox/Filter.pm
did a lot more with MIME parts replacment and removal:
https://public-inbox.org/meta/8b78a44163743dcd4a235a1bc661471e29f091e6/s/
(but was too intrusive with DKIM)
--
unsubscribe: meta+unsubscr...@public-inbox.org
archive: https://public-inbox.org/meta/

Reply via email to