[PR #1491] [MERGED] feat(other): add HTML email sanitizer to remove external background images #1555

Closed
opened 2026-02-25 21:38:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/1491
Author: @Baraka24
Created: 4/13/2025
Status: Merged
Merged: 4/14/2025
Merged by: @kroky

Base: masterHead: sanitize_email_html


📝 Commits (1)

  • ee60faf feat(other): add HTML email sanitizer to remove external background images

📊 Changes

2 files changed (+15 additions, -1 deletions)

View changed files

📝 modules/core/message_functions.php (+13 -0)
📝 modules/imap/output_modules.php (+2 -1)

📄 Description

🍰 Pullrequest

Issues

Add sanitize_email_html function that:

  • Parses HTML content with DOMDocument
  • Removes potentially dangerous background-image URLs (http/https)
  • Preserves all other HTML structure and styling
  • Handles malformed HTML gracefully with libxml error suppression

Todo


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/1491 **Author:** [@Baraka24](https://github.com/Baraka24) **Created:** 4/13/2025 **Status:** ✅ Merged **Merged:** 4/14/2025 **Merged by:** [@kroky](https://github.com/kroky) **Base:** `master` ← **Head:** `sanitize_email_html` --- ### 📝 Commits (1) - [`ee60faf`](https://github.com/cypht-org/cypht/commit/ee60fafbefeb89004c1c3ee23034ced2f7365aae) feat(other): add HTML email sanitizer to remove external background images ### 📊 Changes **2 files changed** (+15 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `modules/core/message_functions.php` (+13 -0) 📝 `modules/imap/output_modules.php` (+2 -1) </details> ### 📄 Description <!-- You can find the latest issue templates here https://github.com/ulfgebhardt/issue-templates --> <!-- Validate your PR title - a quick Guide A valid PR title contains a type (https://github.com/commitizen/conventional-commit-types/blob/master/index.json), a scope (https://github.com/cypht-org/cypht/blob/master/.github/workflows/test.lint.pr.yml#L31) and a title starting with a lower case letter. Here are some valid examples: - fix(frontend): my fix - feat(backend): my feature - docs(docker): my docs - refactor(frontend/backend) : my refactor - test(unit): my test --> ## 🍰 Pullrequest <!-- Describe the Pullrequest. Use Screenshots if possible. --> ### Issues <!-- Which Issues does this fix, which are related? - fixes #XXX - relates #XXX --> Add sanitize_email_html function that: - Parses HTML content with DOMDocument - Removes potentially dangerous background-image URLs (http/https) - Preserves all other HTML structure and styling - Handles malformed HTML gracefully with libxml error suppression ### Todo <!-- In case some parts are still missing, list them here. --> - [X] Test Cypht With [Email Privacy Tester](https://www.emailprivacytester.com/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:38:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1555
No description provided.