10 Commits
Author SHA1 Message Date
Dat Dang 5807b75604 2509 Sanitize composer reply/forward, mailto and pasted content (#5069) 2026-10-29 15:15:29 +07:00
Dat H. Pham e7d9c421b3 fix: prevent orphaned inline attachments from being re-forwarded
In replaceImageBase64ToImageCID, the early-return path blindly returned
all inline attachments even when none were referenced by a cid: img tag
in the HTML body. This caused orphaned inline blobs (CID present in JMAP
metadata but no body reference) to be silently re-attached on every
reply/forward, propagating malformed MIME structure across the thread.

Fix 1: early-return now checks for actual img[src^="cid:"] body references
before including any attachment — orphaned entries are dropped.

Fix 2: after the base64 loop, scan remaining cid: img tags and include
their attachments so images that failed to download are still forwarded.
2026-05-15 13:13:29 +07:00
dab246 aae6302470 TF-4227 Fix MissingStubError: 'keywords' in composer_repository_impl_test 2026-01-19 11:34:43 +07:00
dab246 fedb8fed93 TF-4136 Apply early exit to prevent string operation in log 2026-01-15 09:46:51 +07:00
dab246 5a64ff7e8f TF-3894 Fix blank email content when opening email 2025-09-04 09:30:29 +07:00
DatDang 7f09f9ceb4 TF-3515 Add save email as template feature 2025-05-15 23:32:31 -07:00
dab246 b78aea6103 TF-3514 Add unit test for getMediaTypeFromBase64ImageTag method
Signed-off-by: dab246 <tdvu@linagora.com>

Signed-off-by: dab246 <tdvu@linagora.com>
2025-03-10 03:02:19 -07:00
dab246 ac746b0301 TF-3514 Add test case processing 100 base64 images in HtmlAnalyzer unit test
Signed-off-by: dab246 <tdvu@linagora.com>
2025-03-10 03:02:19 -07:00
dab246 769bca0dda TF-3514 Add test case for unit test HtmlAnalyzer when html content existing CID but inlineAttachments is empty
Signed-off-by: dab246 <tdvu@linagora.com>
2025-03-10 03:02:19 -07:00
dab246 423a6d6016 TF-3514 Add unit test for generateEmail & replaceImageBase64ToImageCID method
Signed-off-by: dab246 <tdvu@linagora.com>
2025-03-10 03:02:19 -07:00