From a5ca63ea52019d75043069e96be5893440413ee4 Mon Sep 17 00:00:00 2001 From: bsiggel Date: Tue, 31 Mar 2026 06:01:10 +0000 Subject: [PATCH] feat(ragflow): Add MIME type filter to skip unsupported file uploads --- src/steps/crm/akte/akte_sync_event_step.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/steps/crm/akte/akte_sync_event_step.py b/src/steps/crm/akte/akte_sync_event_step.py index e9f55ae..9ae0dc8 100644 --- a/src/steps/crm/akte/akte_sync_event_step.py +++ b/src/steps/crm/akte/akte_sync_event_step.py @@ -636,6 +636,20 @@ async def _run_ragflow_sync( if not mime_type: mime_type = 'application/octet-stream' + # ── Dateityp-Filter: nur unterstützte MIME-Typen hochladen ────────── + is_eml = filename.lower().endswith('.eml') or mime_type == 'message/rfc822' + if not is_eml and mime_type not in RAGFlowService.SUPPORTED_MIME_TYPES: + ctx.logger.info( + f" ⏭️ Nicht unterstützter Dateityp ({mime_type}) – übersprungen" + ) + if not ragflow_doc_id: + await espocrm.update_entity('CDokumente', doc_id, { + 'aiSyncStatus': 'unsupported', + 'aiLastSync': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), + }) + skipped += 1 + continue + try: if ragflow_doc_id and not content_changed and meta_changed: # ── Nur Metadaten aktualisieren ───────────────────────────