@Test
    public void testOutlookParsing() throws Exception {

        ContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();

        try (InputStream stream = getResourceAsStream("/test-documents/test-outlook.msg")) {
            AUTO_DETECT_PARSER.parse(stream, handler, metadata, new ParseContext());
        }
        assertEquals("application/vnd.ms-outlook", metadata.get(Metadata.CONTENT_TYPE));
        assertEquals("Microsoft Outlook Express 6", metadata.get(TikaCoreProperties.TITLE));
        assertEquals("Nouvel utilisateur de Outlook Express",
                metadata.get(Metadata.MESSAGE_RECIPIENT_ADDRESS));
        assertEquals("L'\u00C9quipe Microsoft Outlook Express",
                metadata.get(TikaCoreProperties.CREATOR));

        //ensure that "raw" header is correctly decoded
        assertEquals("L'\u00C9quipe Microsoft Outlook Express <msoe@microsoft.com>",
                metadata.get(Metadata.MESSAGE_RAW_HEADER_PREFIX + "From"));

        assertEquals("Nouvel utilisateur de Outlook Express",
                metadata.get(Message.MESSAGE_TO_EMAIL));

        assertEquals("", metadata.get(Message.MESSAGE_TO_NAME));

        assertEquals("Nouvel utilisateur de Outlook Express",
                metadata.get(Message.MESSAGE_TO_DISPLAY_NAME));

        // Stored as Thu, 5 Apr 2007 09:26:06 -0700
        assertEquals("2007-04-05T16:26:06Z", metadata.get(TikaCoreProperties.CREATED));

        String content = handler.toString();
        assertNotContained("Microsoft Outlook Express 6", content);
        assertNotContained("L'\u00C9quipe Microsoft Outlook Express", content);
        assertNotContained("Nouvel utilisateur de Outlook Express", content);


        //now try with inlining select headers
        ParseContext parseContext = new ParseContext();
        OfficeParserConfig officeParserConfig = new OfficeParserConfig();
        officeParserConfig.setWriteSelectHeadersInBody(true);
        parseContext.set(OfficeParserConfig.class, officeParserConfig);
        content = getText("test-outlook.msg", new Metadata(), parseContext);
        assertTrue(content.startsWith("Microsoft Outlook Express 6"));
    }
Test case for parsing Outlook files.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/test/java/org/apache/tika/parser/microsoft/OutlookParserTest.java