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. ----------------------------------------------------------------------------