HTMLConv
Released


Rolf Lochbuehler releases HTMLConv (HCONV_10.ZIP, 41,377Kb) and uploads the file on Pete Norloffs BBS. HtmlConv is a converter for text/html emails. It converts a text/html email file into a multipart/alternative email file with a text/plain version of the original text/html email as its first part.


_________________________________________________________________
| |
| What is HtmlConv? |
|_________________________________________________________________|


HtmlConv has been written to be used with the filter feature of PMMail for OS/2. However, it may also be used with any other email client that can run an external program to modify incoming emails.

HtmlConv may also be used as a command line tool if the input file contains only one single email.

_________________________________________________________________
| |
| This is important! |
|_________________________________________________________________|

HtmlConv is freeware.

So, strictly speaking, you should not expect this program to do anything else than to decrease the amount of free memory in your computer. Since you don't pay anything for this program, this is actually already a bit of feature overkill... ;-)

Anyway, I appreciate any suggestions how to improve HtmlConv. If you find that HtmlConv doesn't work as you think it should, send me a note. If possible, please attach an example for an email that causes the problem.

_________________________________________________________________
| |
| The most recent version of HtmlConv |
|_________________________________________________________________|

I will upload the most recent version of HtmlConv to Hobbes (http://hobbes.nmsu.edu/ or ftp://hobbes.nmsu.edu/) only.

I have no particular preferences for Hobbes, except that it's one of the better known OS/2 software servers in that part of the world where I presently happen to live.

_________________________________________________________________
| |
| Files in the HtmlConv distribution |
|_________________________________________________________________|

filter.bmp - Example for PMMail filter settings
history - Release history
history.sig - My PGP signature for history
liesmich - Readme file for German speakers
liesmich.sig - My PGP signature for liesmich
mime.bmp - Example for MIME Associations settings for text/html
readme - This file
readme.sig - My PGP signature for readme
htmlconv.c - The source code of HtmlConv
htmlconv.exe - The HtmlConv executable
htmlconv.sig - My PGP signature for htmlconv.c
todo - List of missing features, workarounds, restrictions, etc.
todo.sig - My PGP signature for todo

_________________________________________________________________
| |
| Problems solved by HtmlConv |
|_________________________________________________________________|

Some developers of email clients now think it's cool to have their software send emails in text/html format by default. Many users are either not aware of this or don't know how to change this setting.

PMMail for OS/2 doesn't know about HTML. It displays the HTML code unmodified in the Read Message Window. Of course HTML source text is not easy to read.

Anyway, you will usually notice that the contents of most text/html emails does not really justify the usage of HTML instead of plain text, but that's another problem...

_________________________________________________________________
| |
| How HtmlConv solves these problems |
|_________________________________________________________________|

HtmlConv is a converter for text/html emails. It converts a text/html email file into a multipart/alternative email file with a text/plain version of the original text/html email as its first part.

Using HtmlConv you will see a text/plain version of the original text/html email in the Read Message Window of PMMail.

The contents of the text/plain email will be (or at least should be ;-) identical to the original text/html email - except that it will be plain text.

With the proper PMMail filter set-up (see below), HtmlConv will convert any incoming text/html email to a multipart/alternative email, that consists of two parts:

(1) A text/plain part:
This is a reduced-formatting version of the original text/html email. Almost all HTML tags are simply removed from the original text. This text/plain part will be automatically displayed in PMMail's Read Message Window.

(2) A text/html part:
This is the unmodified, original text/html email. You may view it by double clicking on the icon of this attachment, but you may have to change your PMMail settings before this works. See below for instructions how to do that.

_________________________________________________________________
| |
| Using HtmlConv |
|_________________________________________________________________|

If you enter HtmlConv in a command line window, the program will output some helpful informations to the screen.

To use HtmlConv you first need to put htmlconv.exe in a directory of your choice. This directory doesn't have to be listed in your PATH environvent variable, and it also doesn't have to be any of the PMMail directories.

To use HtmlConv as a converter for incoming text/html emails in PMMail, you want to set up a filter in PMMail that calls HtmlConv. Here's how to do that:

(1) Go to Account->Account Settings...->Filters

In PMMail version prior to 1.96 you may have to go to Account->Utilities Settings...->Filters

(2) Click on New.

(3) Enter the following data in the Edit Filter window (see filter.bmp for an example):

Desription Any name you like
Enabled [should be checked]
Simple
Search <Header>
For Content-Type: text/html
Type Incoming
Actions REXX Exit (Background) x:\full\path\to\htmlconv.exe

You don't need to enter any arguments or %s after HtmlConv.exe.

During the first time it's usually helpful to add the "Inform User" action, so you can know when this filter finds a matching email and calls HtmlConv.

(4) Click on OK.

(5) Make shure there is no filter that moves incoming text/html messages out of the Inbox, before HtmlConv had a chance to convert them. If necessary, use the Up/Down buttons to change the filter sequence.

(6) Make sure that there is no other conflict with another filter. That's the hardest part, and you're on your own... good luck ;-)

That's it.

_________________________________________________________________
| |
| How to view the text/plain part |
|_________________________________________________________________|

The text/plain part should be displayed once you double-click on the message in PMMail's message list. (Actually that's the main purpose of HtmlConv...)

_________________________________________________________________
| |
| How to view the text/html part |
|_________________________________________________________________|

You may still view the unaltered, original text/html part by double clicking on the second attachment. There are two ways how to do that:

(1) Just drag and drop the first attachment on your favorite WWW browser.

(2) In case you haven't done this yet, go to PMMail->Settings->MIME Associations, klick on Add and enter the following data (see mime.bmp for an example):

Description HTML
MIME Type text / html
File Extension html htm
Program To execute: x:\path\to\your\favorite\browser.exe
Arguments: [other arguments if necessary] %s
Working Directory [leave this field empty]
Program Type [depends on your browser]

Now a double click on the first attachment should load it into your WWW browser.

_________________________________________________________________
| |
| How to test HtmlConv |
|_________________________________________________________________|

HtmlConv reads a file, modifies it, and re-writes it. Hence you may test HtmlConv using any file that contains a text/html email.

Warning: HtmlConv overwrites the original email file. So, you want to make a backup of the original file before testing HtmlConv.

However, make shure that the input email file also contains the header of the email. If you configure PMMail not to display email headers by default, it will also not save the header to a file. To save the body and the header in this case, you need to open the email, click on "Toggle Display Of The Message Header" and then save it to a file.

CONTACT AUTHOR:

Rolf Lochbuehler
rolf.lochbuehler@ibm.net
To get Author's PGP public key, send he an ampty email with "send pgp key" in the subject line.


@Macarlo, Inc.
@Macarlo's Shareware & Web
OS/2
Java Lobby Member
Java Site Accredited

[TOP] [HOME] [INDEX]