[PR #553] [MERGED] feat: add JUNK_MAIL_CHECK_LIST for check exits and passed item && add ParsedEmailContext to cache the parsed Email #618

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

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553
Author: @dreamhunter2333
Created: 1/11/2025
Status: Merged
Merged: 1/11/2025
Merged by: @dreamhunter2333

Base: mainHead: feature/dev


📝 Commits (2)

  • 3ec451d feat: Junk mail only check JUNK_MAIL_FORCE_PASS_LIST
  • 3881e6c feat: add JUNK_MAIL_CHECK_LIST for check exits and passed item && add ParsedEmailContext to cache the parsed Email

📊 Changes

12 files changed (+100 additions, -56 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 vitepress-docs/docs/en/cli.md (+2 -0)
📝 vitepress-docs/docs/zh/guide/cli/worker.md (+3 -1)
📝 worker/src/admin_api/mail_webhook_settings.ts (+3 -3)
📝 worker/src/admin_api/worker_config.ts (+1 -0)
📝 worker/src/common.ts (+16 -9)
📝 worker/src/email/check_junk.ts (+22 -12)
📝 worker/src/email/index.ts (+25 -20)
📝 worker/src/mails_api/webhook_settings.ts (+3 -3)
📝 worker/src/telegram_api/telegram.ts (+7 -6)
📝 worker/src/types.d.ts (+13 -1)
📝 worker/wrangler.toml.template (+3 -1)

📄 Description

PR Type

enhancement, bug fix


Description

  • Introduced ParsedEmailContext to cache parsed email content.

  • Added JUNK_MAIL_CHECK_LIST for conditional junk mail checks.

  • Updated functions to use ParsedEmailContext instead of raw email strings.

  • Enhanced error handling in email processing functions.


Changes walkthrough 📝

Relevant files
Enhancement
8 files
mail_webhook_settings.ts
Use `ParsedEmailContext` in testWebhookSettings                   
+3/-3     
worker_config.ts
Add `JUNK_MAIL_CHECK_LIST` to worker configuration             
+1/-0     
common.ts
Refactor common mail functions to use `ParsedEmailContext`
+13/-8   
check_junk.ts
Implement `JUNK_MAIL_CHECK_LIST` in junk mail check           
+22/-12 
index.ts
Use `ParsedEmailContext` in email processing                         
+25/-20 
webhook_settings.ts
Use `ParsedEmailContext` in testWebhookSettings                   
+3/-3     
telegram.ts
Use `ParsedEmailContext` in Telegram mail functions           
+7/-6     
types.d.ts
Add `ParsedEmailContext` type definition                                 
+13/-1   
Documentation
3 files
CHANGELOG.md
Update changelog with new features                                             
+2/-0     
cli.md
Document `JUNK_MAIL_CHECK_LIST` configuration                       
+2/-0     
worker.md
Document `JUNK_MAIL_CHECK_LIST` configuration in Chinese 
+3/-1     
Configuration changes
1 files
wrangler.toml.template
Add `JUNK_MAIL_CHECK_LIST` to wrangler template                   
+3/-1     

💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant 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/553 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 1/11/2025 **Status:** ✅ Merged **Merged:** 1/11/2025 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/dev` --- ### 📝 Commits (2) - [`3ec451d`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/3ec451d0c2a2728ac747be263847bc437e0d39c4) feat: Junk mail only check JUNK_MAIL_FORCE_PASS_LIST - [`3881e6c`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/3881e6ccf12ff6f7e4e9de4e203ec3466dc3a608) feat: add `JUNK_MAIL_CHECK_LIST` for check exits and passed item && add `ParsedEmailContext` to cache the parsed Email ### 📊 Changes **12 files changed** (+100 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `vitepress-docs/docs/en/cli.md` (+2 -0) 📝 `vitepress-docs/docs/zh/guide/cli/worker.md` (+3 -1) 📝 `worker/src/admin_api/mail_webhook_settings.ts` (+3 -3) 📝 `worker/src/admin_api/worker_config.ts` (+1 -0) 📝 `worker/src/common.ts` (+16 -9) 📝 `worker/src/email/check_junk.ts` (+22 -12) 📝 `worker/src/email/index.ts` (+25 -20) 📝 `worker/src/mails_api/webhook_settings.ts` (+3 -3) 📝 `worker/src/telegram_api/telegram.ts` (+7 -6) 📝 `worker/src/types.d.ts` (+13 -1) 📝 `worker/wrangler.toml.template` (+3 -1) </details> ### 📄 Description ### **PR Type** enhancement, bug fix ___ ### **Description** - Introduced `ParsedEmailContext` to cache parsed email content. - Added `JUNK_MAIL_CHECK_LIST` for conditional junk mail checks. - Updated functions to use `ParsedEmailContext` instead of raw email strings. - Enhanced error handling in email processing functions. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8 files</summary><table> <tr> <td><strong>mail_webhook_settings.ts</strong><dd><code>Use `ParsedEmailContext` in testWebhookSettings</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-a8888cea638671df084f06f14c82a84294903585f3a218161847b0a96d044821">+3/-3</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>worker_config.ts</strong><dd><code>Add `JUNK_MAIL_CHECK_LIST` to worker configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-49df0a54d190cb8ea3788432fae88000683da8e61a5c4d0d184c8b7f0015a0ae">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>common.ts</strong><dd><code>Refactor common mail functions to use `ParsedEmailContext`</code></dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-fcc08fd5aa3c190d0d45c7e3dd208e5ee831d360b272fdd5869607cf472c5eb1">+13/-8</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>check_junk.ts</strong><dd><code>Implement `JUNK_MAIL_CHECK_LIST` in junk mail check</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-565fa6622914712e83a6155e454ec724434edd8778070fc25efcd1ba613030a5">+22/-12</a>&nbsp; </td> </tr> <tr> <td><strong>index.ts</strong><dd><code>Use `ParsedEmailContext` in email processing</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-da1768152a73f37b0a0780d578569f84c3d4bb946294e3a81fb0271302e6d816">+25/-20</a>&nbsp; </td> </tr> <tr> <td><strong>webhook_settings.ts</strong><dd><code>Use `ParsedEmailContext` in testWebhookSettings</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-0c4fdb3ef2a70f77455a6458c649932abb800e668143eb85d12c95ef911bfb37">+3/-3</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>telegram.ts</strong><dd><code>Use `ParsedEmailContext` in Telegram mail functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-a62d9c6ad0b04691396db4eecb38680ea80a2690f021e18baa6012ad525a27d3">+7/-6</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>types.d.ts</strong><dd><code>Add `ParsedEmailContext` type definition</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-583fb024d5c9d1efac71bbea788d8379e5e8fc2f0bb1696a9863c6f6cac54bee">+13/-1</a>&nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>CHANGELOG.md</strong><dd><code>Update changelog with new features</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>cli.md</strong><dd><code>Document `JUNK_MAIL_CHECK_LIST` configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-3f8f72a691fa19c8581621e91cf67ad28855af7a57e58513f6563cf4c8886e5f">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>worker.md</strong><dd><code>Document `JUNK_MAIL_CHECK_LIST` configuration in Chinese</code>&nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-f760a2ec5dad4b6bda0bd4a9325274567778add8cb984e73650dbaaf680c9178">+3/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>wrangler.toml.template</strong><dd><code>Add `JUNK_MAIL_CHECK_LIST` to wrangler template</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/553/files#diff-743273da72481b71fbeb1dddfd294be9249554eef65691dfc9bcfa9f0fd971fb">+3/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --- <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:04 +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#618
No description provided.