Text (.MSG) file to .MBX (Unix mail file format, used by
popular mail clients like Eudora or Netscape Messenger)
conversion utility v0.1 .         FREEWARE. OPEN SOURCE!
------------------------------------------------------------

Primarly I have written this utility to close a gap between
all those standard programs and Phoenix, the great Freeware
and Open Source mail program. Phoenix still saves every mail
as a single file which requires incredible disk space 
especially if a user's harddisk has still 32k Clusters.
I consider this as not acceptable (for me) and decided to 
support the project with this utility. Maybe this opens the
door for generic .MBX support by Phoenix - YEAH! ;-))


NO SUPPORT, NO WARRANTIES.
Published 1999 by Richard Fellner. http://Inner-Smile.com
Included source code has been developed using Delphi 4.03 
(perfectly compileable under Delphi 2.x and 3.x, too,
simply ignore all warnings).

The utility is very basic in its current state, if you 
improve it, please provide me with an updated version. 

To-do-list:
* create Eudora-compatible .TOC index files
* create Messenger-compatible .SNM index files
* bullet-proof error-checking
* option to strip inline attachements

***********************************************************************
SUGGESTED LINKS FOR FURTHER INVESTIGATION, DOWNLOADS AND UPDATES:
***********************************************************************

The Phoenix Mail Homepage
(here you can get the latest release of Phoenix Mail)
http://www.pobox.com/~touri/phoenix/

The Phoenix Mail Development Group
(if you want to contribute with Delphi code, join here)
http://www.highq.com/Jon/phoenixdev/

Richey's DELPHI-BOX
1000++ links & tips about Delphi, get the latest converter version here
http://Inner-Smile.com
email r.fellner@bigfoot.com

MBX->Text conversion utility by T.Gitlin
(the other direction: extract .MSG files from .MBX files.
Great if you want to change from Eudora,Messenger,... to Phoenix)
http://www.erols.com/tgitlin

----------------------------------------------------------------------------
Some notes on the MBX Mailbox file format
by Michael Santovec (michael_santovec@prodigy.net)
----------------------------------------------------------------------------
Notes on file formats:
 - Character strings are represented by the following notation: "ABCXYZ"
 - Hexadecimal strings are resented by the following notation: x'012DEF'
 - Binary numbers are stored in the normal PC format of least significant
byte to most significant byte.  For example, decimal 266 (hex 10A) would be
stored in a 4 byte field as x'0A010000'
 - Field locations are given in both absolute decimal (relative to 1) and
hexadecimal offset (relative to 0).  For example: "1-16 (0-F)" indicates a
16 byte field that starts at the beginning of a record.MBX File Format


This file consists of a file header followed by 0 or more messages.

MBX File Header Length 84 bytes (hex 54 )
 - 1-4 (0-3) - 4 byte character string "JMF6" - file id

 - 5-8 (4-7) - 4 byte hex string x'03000101' - ?

 - 9-12 (8-B) - 4 byte binary number - number of messages in the file,
including messages marked for deletion.  This number only goes down when
the file is compacted.

 - 13-16 (C-F) - 4 byte binary number - last used message number.  Each
time a message is added to this file, this number is incremented and used
as the message number.  This number never goes down, even when the file is
compacted.

 - 17-20 (10-13) - 4 byte binary number - size of this file in
bytes.

 - 21 (14) - 1 byte hex string x'01' - ?

 - 22-84 (15-53) - 63 byte hex string, all x'00' - ?MBX Message


Each message consists of a message header, the message text, and an
optional padding field.
 - 1-4 (0-3) - 4 byte hex string x'007F007F' - start of message id

 - 5-8 (4-7) - 4 byte binary number - message number

 - 9-12 (8-B) - 4 byte binary number - total size of the message including
the message header, message text and any optional padding field

 - 13-16 (C-F) - 4 byte binary number - size of the following message text

 - 17-? (10-?) - character field, size specified in previous field - the
message text exactly as received from the POP3 server.  This includes the
e-mail headers (e.g. From:, To:, etc.), and any encoded attachments.

 - ?-? (?-?) - 0 to 3 bytes hex string, all x'00' - the size of this field
varies to make the whole message a multiple of 4 bytes long.  However, as
long as this field is properly accounted for in the above total size of the
message, this field can be any length and the mail program will
workproperly.
----------------------------------------------------------------------------
