[Mimedefang] Mimedefang to strip HTML via sieve
Bill Cole
mdlist-20140424 at billmail.scconsult.com
Mon Dec 21 13:55:55 EST 2020
On 18 Dec 2020, at 8:21, @lbutlr wrote:
> Does anyone have a sieve setup that removes html enclosures (or
> converts them to plain text, even better)? I want to do this for
> specific mails, not globally for the server, so I think sieve is the
> way to go here rather than a milter.
So, why ask on this list?
Obviously, MD can do this. remove_redundant_html_parts() (documented in
the mimedefang-filter man page) exists. MD can select messages to act
upon by any criteria you like.
> If there is a way to edit the HTML of specific messages, that would
> also be useful. (For example, changing text colors to black instead of
> carrying shades of light grey).
Sieve seems like an entirely wrong place to do that sort of surgery on
messages. It is entirely feasible to programmatically edit the HTML of a
message in MD, which is designed for doing radical message surgery. MD
passes each of the filter* subroutines a Mime::Entity object containing
the relevant MIME object (whole message or sub-part) and metadata. You
can modify it at will.
--
Bill Cole
bill at scconsult.com or billcole at apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire
More information about the MIMEDefang
mailing list