public static void extract(MAPIMessage msg, Metadata metadata) {
        if (msg.getNameIdChunks() == null) {
            return;
        }
        if (msg.getMainChunks() == null || msg.getMainChunks().getRawProperties() == null) {
            return;
        }
        //prep our custom nameIdChunk handler
        TikaNameIdChunks tikaNameIdChunks = new TikaNameIdChunks();
        //short-circuit for files that have an empty nameIdChunk
        long len = 0;
        for (Chunk chunk : msg
                .getNameIdChunks()
                .getAll()) {
            if (chunk == null) {
                continue;
            }
            tikaNameIdChunks.record(chunk);
            if (chunk instanceof ByteChunk) {
                byte[] value = ((ByteChunk)chunk).getValue();
                if (value != null) {
                    len += value.length;
                }
            }
        }
        if (len == 0) {
            return;
        }
        try {
            tikaNameIdChunks.chunksComplete();
        } catch (IllegalStateException e) {
            LOGGER.warn("bad namechunks stream", e);
        }
        for (Map.Entry<MAPIProperty, PropertyValue> e : msg
                .getMainChunks()
                .getRawProperties()
                .entrySet()) {
            //the mapiproperties from POI are the literal storage id for that particular file.
            //Those storage ids must be mapped via the name chunk ids into a known id
            PropertyValue v = e.getValue();
            if (v == null) {
                continue;
            }
            List<MAPITag> mapiTags = tikaNameIdChunks.getTags(e.getKey().id);
            MAPITagPair pair = null;
            for (MAPITag mapiTag : mapiTags) {
                List<TikaMapiProperty> tikaMapiProperties = TIKA_MAPI_LONG_PROPERTIES.get(mapiTag.tagId);
                if (tikaMapiProperties == null) {
                    tikaMapiProperties = TIKA_MAPI_PROPERTIES.get(mapiTag.tagId);
                }
                pair = findMatch(mapiTag, tikaMapiProperties, v);
                if (pair != null) {
                    break;
                }
            }
            updateMetadata(pair, v, metadata);
        }
    }
This class extracts mapi properties as defined in the props_table.txt, which was generated from MS-OXPROPS.
For now, this ignores binary and unknown property types.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/msg/ExtendedMetadataExtractor.java