29 Oct 2017 movement   » (Master)

Converting HTML mail via procmail

All the procmail recipes I found on a quick search failed to handle quoted-printable HTML encodings, regularly used everywhere. And those that had quoted-printable examples used tools no longer maintained - such as mimencode.

The solution is to use Perl directly:


:0
* ^Content-Type: text/html;
{
:0c
html/
:0fwb
* ^Content-Transfer-Encoding: *quoted-printable
| perl -pe 'use MIME::QuotedPrint; $_=MIME::QuotedPrint::decode($_);'
:0fwb
| lynx -dump -force_html -stdin
:0fwh
| formail -i "Content-Type: text/plain; charset=us-ascii"
}

Syndicated 2016-11-03 20:27:00 (Updated 2016-11-03 20:33:04) from John Levon

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!