From b070af8503168b9c42c7b7ecb1c5df1ce6d1dccb Mon Sep 17 00:00:00 2001
From: 1sonhador <1sonhador@gmail.com>
Date: Wed, 1 Jul 2026 09:18:11 +0100
Subject: [PATCH] fix: forward original email via SMTP instead of .eml
attachment
Re-send the received RFC822 message with normal Fwd headers (To, From,
Subject). The previous code wrapped the message in message/rfc822 with
filename original-email.eml, which the relay rejected.
---
README.md | 2 +-
admin-ui/src/pages/Accounts.tsx | 2 +-
src/forwarder/email/smtp_client.py | 85 +++++++++++---------------
src/forwarder/services/sync_service.py | 16 +----
tests/test_smtp_forward.py | 42 +++++++------
5 files changed, 64 insertions(+), 83 deletions(-)
diff --git a/README.md b/README.md
index 61a2e8a..e992f41 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# BizDocs Forwarder
-Multi-account IMAP → BizDocs forwarder: detect invoice attachments (PDF/XML/ZIP), re-send via SMTP.
+Multi-account IMAP → BizDocs forwarder: detect invoice attachments (PDF/XML/ZIP), forward original email via SMTP.
- **Repo:** https://git.bitreport.pt/BitReport.pt/forwarder
- **Paperclip:** http://10.10.50.17:3100/BIT/projects/bizdocs-forwarder
diff --git a/admin-ui/src/pages/Accounts.tsx b/admin-ui/src/pages/Accounts.tsx
index e3337b1..967f7a8 100644
--- a/admin-ui/src/pages/Accounts.tsx
+++ b/admin-ui/src/pages/Accounts.tsx
@@ -131,7 +131,7 @@ function AccountModal({