$ show mvz/email-outlook-message-perl
Email::Outlook::Message is a Perl library for reading Microsoft Outlook .msg files and converting them to standard email MIME objects. It parses the OLE compound document format, extracts MAPI properties (headers, body in plain text/HTML/RTF, attachments, recipients), and reconstructs an Email::MIME object suitable for further processing or sending. The architecture uses a base class for generic OLE property stream parsing with encoding detection, with specialized subclasses for addresses and attachments. A command-line tool, msgconvert, is included for batch conversion to .eml or mbox format. The library does not require Outlook and works cross-platform. The codebase is well-structured, with good separation of concerns and a test suite covering various message types, though GPG-signed message support is incomplete.
The LLM identified 3 files worth highlighting for reuse:
Provides a generic framework for parsing OLE property streams within .msg files. It handles fixed-length and variable-length MAPI properties, decodes encodings (Unicode, ASCII, binary, dates, integers, booleans), and offers a logging mechanism for known and unknown properties. This component could be extracted as a standalone MAPI property reader for any .msg or OLE file.
The _create_mime_rtf_body method implements decompression of compressed RTF content as stored in Outlook .msg files, based on the documented algorithm (magic numbers 0x75465a4c and 0x414c454d). It is a self-contained implementation of a specific LZ77-like decompression that could be reused for extracting RTF from any .msg file.
Handles extraction of attachments from .msg files, including support for nested .msg files (embedded emails). It properly identifies nested OLE structures that represent embedded messages and converts them to message/rfc822 MIME parts. This component demonstrates clean handling of recursive OLE parsing and attachment metadata (filename, MIME type, content ID).