19 package org.sleuthkit.autopsy.thunderbirdparser;
21 import java.io.FileNotFoundException;
22 import java.io.IOException;
23 import org.apache.james.mime4j.MimeException;
24 import org.apache.james.mime4j.dom.Message;
32 class 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());