mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
vbox funzionanti
This commit is contained in:
@@ -296,8 +296,8 @@ def _extract_eml_in_eml(
|
||||
"""
|
||||
Estrae il messaggio EML annidato in un part message/rfc822.
|
||||
|
||||
Nella struttura PEC, questo è tipicamente il messaggio originale
|
||||
allegato alle ricevute di consegna/accettazione.
|
||||
Per postacert.eml (busta PEC in arrivo): ricorre dentro per estrarre
|
||||
gli allegati utente e il corpo del messaggio originale del mittente.
|
||||
"""
|
||||
try:
|
||||
payload = part.get_payload()
|
||||
@@ -330,6 +330,20 @@ def _extract_eml_in_eml(
|
||||
)
|
||||
result.attachments.append(att)
|
||||
|
||||
# Per postacert.eml: ricorre dentro per trovare allegati utente e corpo originale
|
||||
if is_system and eff_filename.lower() == "postacert.eml":
|
||||
inner_parsed = parse_eml(inner_bytes)
|
||||
# Allegati non-sistema del messaggio originale del mittente
|
||||
for inner_att in inner_parsed.attachments:
|
||||
if not inner_att.is_pec_system:
|
||||
result.attachments.append(inner_att)
|
||||
# Corpo del messaggio originale (più utile del testo della busta PEC)
|
||||
if inner_parsed.body_html:
|
||||
result.body_html = inner_parsed.body_html
|
||||
result.body_text = inner_parsed.body_text
|
||||
elif inner_parsed.body_text:
|
||||
result.body_text = inner_parsed.body_text
|
||||
|
||||
except Exception as exc:
|
||||
logger.warning(f"Errore estrazione EML-in-EML: {exc}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user