Go to the documentation of this file.
19package org.sleuthkit.autopsy.thunderbirdparser;
21import java.io.FileNotFoundException;
22import java.io.IOException;
23import org.apache.james.mime4j.MimeException;
24import org.apache.james.mime4j.dom.Message;
25import org.sleuthkit.datamodel.AbstractFile;
26import org.sleuthkit.datamodel.ReadContentInputStream;
32class EMLParser
extends MimeJ4MessageParser {
43 static boolean isEMLFile(AbstractFile abFile,
byte[] buffer) {
44 String ext = abFile.getNameExtension();
45 boolean isEMLFile = ext !=
null && ext.equals(
"eml");
47 isEMLFile = (
new String(buffer)).contains(
":");
63 static EmailMessage parse(AbstractFile sourceFile)
throws FileNotFoundException, IOException, MimeException {
64 try (ReadContentInputStream fis =
new ReadContentInputStream(sourceFile)) {
65 EMLParser parser =
new EMLParser();
66 parser.setLocalPath(sourceFile.getParentPath());
67 Message mimeMsg = parser.getMessageBuilder().parseMessage(fis);
68 return parser.extractEmail(mimeMsg,
"", sourceFile.getId());
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.