Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

force eml file to be parsed by EMAIL (#2615)

Kevin Hu297b2d0ac986
diff --git a/api/apps/dataset_api.py b/api/apps/dataset_api.py
index d00c52bb80..f8e2d1930c 100644
--- a/api/apps/dataset_api.py
+++ b/api/apps/dataset_api.py
@@ -381,6 +381,8 @@ def upload_documents(dataset_id):
doc["parser_id"] = ParserType.AUDIO.value
if re.search(r"\.(ppt|pptx|pages)$", filename):
doc["parser_id"] = ParserType.PRESENTATION.value
+ if re.search(r"\.(eml)$", filename):
+ doc["parser_id"] = ParserType.EMAIL.value
DocumentService.insert(doc)
FileService.add_file_from_kb(doc, kb_folder["id"], dataset.tenant_id)
diff --git a/api/apps/document_app.py b/api/apps/document_app.py
index b33bff4cdf..0f69dc5ee1 100644
--- a/api/apps/document_app.py
+++ b/api/apps/document_app.py
@@ -139,6 +139,8 @@ def web_crawl():
doc["parser_id"] = ParserType.AUDIO.value
if re.search(r"\.(ppt|pptx|pages)$", filename):
doc["parser_id"] = ParserType.PRESENTATION.value
+ if re.search(r"\.(eml)$", filename):
+ doc["parser_id"] = ParserType.EMAIL.value
DocumentService.insert(doc)
FileService.add_file_from_kb(doc, kb_folder["id"], kb.tenant_id)
except Exception as e: