s/&/\&/g
s/</\&lt;/g
s/>/\&gt;/g
s/"/\&quot;/g
1s/^/<HTML><PRE>/
$s/$/<\/PRE><\/HTML>/

Won't be pretty, but will do what you requested.

On Wed, Nov 26, 2025 at 9:29 AM <[email protected]> wrote:
>
> Does anybody here know of an AWK or sed program to convert mbox files to HTML?
>
>
>
> My google (well, ddg) fu has not been very helpful -- I've turned up 
> proprietary programs to do that, most of which run on Windows :-(
>
>
>
> I need to have the source code as I will need to modify the conversion in 
> some special ways.
>
>
>
> I guess I could use something other than AWK or sed, but I'm reluctant to use 
> (and learn) some other language (including things like Perl, C[++], or 
> Python, although I think I'd like the syntax of Python the best, just wish it 
> was compiled instead of interpreted (P-code, iiuc)).
>
>
>
> I know that maildir is the currently favored approach for mail storage, but I 
> have well over 100 MB of emails (or pseudo emails) stored in mbox files, and 
> want to convert them for easy viewing on the Internet (by anyone).
>
>
>
> Thanks!

Reply via email to