[PR #796] [MERGED] feat: add source address regex forwarding #770

Closed
opened 2026-02-26 21:32:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796
Author: @dreamhunter2333
Created: 12/29/2025
Status: Merged
Merged: 12/29/2025
Merged by: @dreamhunter2333

Base: mainHead: feature/email


📝 Commits (1)

  • 5f37beb feat: add source address regex forwarding for email rules

📊 Changes

6 files changed (+247 additions, -48 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 CHANGELOG_EN.md (+1 -0)
📝 frontend/src/views/admin/AccountSettings.vue (+100 -7)
worker/src/email/forward.ts (+139 -0)
📝 worker/src/email/index.ts (+3 -41)
📝 worker/src/types.d.ts (+3 -0)

📄 Description

User description

Summary

  • Add source address regex forwarding for email rules
  • Filter forwarding by sender address using regex patterns
  • Fully backward compatible with existing configurations

Changes

  • worker/src/email/forward.ts - New file for forwarding logic
  • worker/src/email/index.ts - Refactored to use new forward module
  • worker/src/types.d.ts - Added sourcePatterns and sourceMatchMode fields
  • frontend/src/views/admin/AccountSettings.vue - UI for regex configuration
  • CHANGELOG.md / CHANGELOG_EN.md - Updated changelog

Features

  • Support multiple regex patterns per rule
  • Two match modes: 'any' (default) and 'all'
  • ReDoS protection (200 char limit)
  • Frontend regex validation

🤖 Generated with Claude Code


PR Type

Enhancement, Tests


Description

  • Introduced source address regex forwarding for email rules.

  • Added frontend UI for regex configuration and validation.

  • Implemented backend logic for regex-based email forwarding.

  • Updated changelogs to document new features.


Changes walkthrough 📝

Relevant files
Enhancement
AccountSettings.vue
Added UI for source address regex configuration and validation

frontend/src/views/admin/AccountSettings.vue

  • Added UI elements for source address regex configuration.
  • Implemented regex validation and match mode selection.
  • Enhanced email forwarding modal with new options and validations.
  • Updated localization strings for new features.
  • +100/-7 
    forward.ts
    Added backend logic for regex-based email forwarding         

    worker/src/email/forward.ts

  • Created new module for email forwarding logic.
  • Added functions for regex validation and matching.
  • Implemented global and rule-based email forwarding.
  • Added ReDoS protection for regex patterns.
  • +139/-0 
    index.ts
    Refactored email forwarding to use new module                       

    worker/src/email/index.ts

  • Refactored email forwarding logic to use new forwardEmail function.
  • Removed old forwarding logic and integrated new module.
  • +3/-41   
    types.d.ts
    Updated types to support source address regex forwarding 

    worker/src/types.d.ts

  • Added sourcePatterns and sourceMatchMode fields to types.
  • Enhanced type definitions for email forwarding rules.
  • +3/-0     
    Documentation
    CHANGELOG.md
    Updated changelog for source address regex forwarding       

    CHANGELOG.md

    • Documented the addition of source address regex forwarding.
    +1/-0     
    CHANGELOG_EN.md
    Updated changelog for source address regex forwarding (English)

    CHANGELOG_EN.md

    • Documented the addition of source address regex forwarding.
    +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.

  • 🔄 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/dreamhunter2333/cloudflare_temp_email/pull/796 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 12/29/2025 **Status:** ✅ Merged **Merged:** 12/29/2025 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/email` --- ### 📝 Commits (1) - [`5f37beb`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/5f37bebebff9a0aea7aa24797f71a00a608127f3) feat: add source address regex forwarding for email rules ### 📊 Changes **6 files changed** (+247 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `CHANGELOG_EN.md` (+1 -0) 📝 `frontend/src/views/admin/AccountSettings.vue` (+100 -7) ➕ `worker/src/email/forward.ts` (+139 -0) 📝 `worker/src/email/index.ts` (+3 -41) 📝 `worker/src/types.d.ts` (+3 -0) </details> ### 📄 Description ### **User description** ## Summary - Add source address regex forwarding for email rules - Filter forwarding by sender address using regex patterns - Fully backward compatible with existing configurations ## Changes - `worker/src/email/forward.ts` - New file for forwarding logic - `worker/src/email/index.ts` - Refactored to use new forward module - `worker/src/types.d.ts` - Added sourcePatterns and sourceMatchMode fields - `frontend/src/views/admin/AccountSettings.vue` - UI for regex configuration - `CHANGELOG.md` / `CHANGELOG_EN.md` - Updated changelog ## Features - Support multiple regex patterns per rule - Two match modes: 'any' (default) and 'all' - ReDoS protection (200 char limit) - Frontend regex validation 🤖 Generated with [Claude Code](https://claude.ai/code) ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Introduced source address regex forwarding for email rules. - Added frontend UI for regex configuration and validation. - Implemented backend logic for regex-based email forwarding. - Updated changelogs to document new features. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>AccountSettings.vue</strong><dd><code>Added UI for source address regex configuration and validation</code></dd></summary> <hr> frontend/src/views/admin/AccountSettings.vue <li>Added UI elements for source address regex configuration.<br> <li> Implemented regex validation and match mode selection.<br> <li> Enhanced email forwarding modal with new options and validations.<br> <li> Updated localization strings for new features. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796/files#diff-d5db89bc5b7ac5d009a78d299aa22f0f0414bbbb5006e88b30f35af8510b6b33">+100/-7</a>&nbsp; </td> </tr> <tr> <td> <details> <summary><strong>forward.ts</strong><dd><code>Added backend logic for regex-based email forwarding</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/email/forward.ts <li>Created new module for email forwarding logic.<br> <li> Added functions for regex validation and matching.<br> <li> Implemented global and rule-based email forwarding.<br> <li> Added ReDoS protection for regex patterns. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796/files#diff-0c969d8b16b60573fb2414bb07bef77828fbff76293932a3d95591c805cfa3eb">+139/-0</a>&nbsp; </td> </tr> <tr> <td> <details> <summary><strong>index.ts</strong><dd><code>Refactored email forwarding to use new module</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/email/index.ts <li>Refactored email forwarding logic to use new <code>forwardEmail</code> function.<br> <li> Removed old forwarding logic and integrated new module. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796/files#diff-da1768152a73f37b0a0780d578569f84c3d4bb946294e3a81fb0271302e6d816">+3/-41</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>types.d.ts</strong><dd><code>Updated types to support source address regex forwarding</code>&nbsp; </dd></summary> <hr> worker/src/types.d.ts <li>Added <code>sourcePatterns</code> and <code>sourceMatchMode</code> fields to types.<br> <li> Enhanced type definitions for email forwarding rules. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796/files#diff-583fb024d5c9d1efac71bbea788d8379e5e8fc2f0bb1696a9863c6f6cac54bee">+3/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>CHANGELOG.md</strong><dd><code>Updated changelog for source address regex forwarding</code>&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> CHANGELOG.md - Documented the addition of source address regex forwarding. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>CHANGELOG_EN.md</strong><dd><code>Updated changelog for source address regex forwarding (English)</code></dd></summary> <hr> CHANGELOG_EN.md - Documented the addition of source address regex forwarding. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/796/files#diff-77d2276dbbf8eb648363b81ea97049986b18e2cf1e90bd20fb5133ed5ff4fcae">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
    kerem 2026-02-26 21:32:53 +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/cloudflare_temp_email#770
    No description provided.