mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-04-26 06:15:52 +03:00
[GH-ISSUE #546] [Feature] webhook功能增强(验证码链接相关) #209
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cloudflare_temp_email#209
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @oneisall8955 on GitHub (Jan 6, 2025).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/546
感谢作者,在此 issue 中 https://github.com/dreamhunter2333/cloudflare_temp_email/issues/224 已经添加了 webhook 通知功能。
希望对这个功能进行下一步加强,我的最终目的是【仅包含验证类的邮件】才转发到 webhook。
场景:在注册账号时候,例如机场,社交,论坛等等,我会用平台的名称/缩写+搭建的临时邮箱域名作为账号名称,接受平台的验证码或者验证链接,我想不打开临时邮箱,通过webhook通知收到验证码/链接。
假设我搭建的临时邮箱服务 https://myawsl.uk 及邮箱后缀是 myawsl.uk,用注册 weibo.com 来举个例子。
注册weibo时候,我会以 weibo@myawsl.uk 作为这个平台的账号名。
需要注意的是,我并没有提前在 https://myawsl.uk 注册 weibo@myawsl.uk 账号。
按照我以前的流程,注册完 weibo@myawsl.uk后, 使用 admin 账号登 https://myawsl.uk ,通过【无收件人邮件列表】来查看邮件获取到 weibo.com 给我发的验证码或链接邮件,再进行验证。
如果使用现在的转发 webhook 功能,是可以做到的不打开自建的 https://myawsl.uk 获取验证码的。
不过会将所有的邮件+其原文一并发送到我的 webhook,造成不必要的通知。
实现这个目的,我想有多种方式
较为简单的一种方式: 转发 webhook 前,执行过滤规则,可以是自定义关键词过滤(并且添加开关),或者用户自定义函数 boolean function filter(string email) 过滤(可能会造成安全风险,毕竟可以直接写js,或许会有用户写删库的操作)
集成验证码/链接识别后转发功能,可以理解为本身就是一个官方的函数调用 boolean function filter(string email)
较完整的功能,但是可能会导致 woker 超时,并且对项目的roadmap有较大的破坏性:经过简单关键词过滤后,向ai接口发起请求,返回验证码。我试过用gpt3.5-turbo & gpt-4 解析邮件,准度挺高的。
通过关键词过滤后下,集成其他专注做验证通知的项目。如: https://github.com/TooonyChen/AuthInbox (通过 https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/ 服务绑定形式直接调用)
@oneisall8955 commented on GitHub (Jan 6, 2025):
一个简单的gpt调用提示例子:
你将接受到一封邮件或者短信内容,内容是text格式,提取出其中的验证码。你只需要回复有没有验证码,如果没有验证码,则回复【没有验证码】,如果有验证码,则回复【你的验证码是:xxxx】。下面是短信或短信的内容:
返回挺准确的
@dreamhunter2333 commented on GitHub (Jan 6, 2025):
感谢反馈,非常详细,我想一下如何集成
@oneisall8955 commented on GitHub (Jan 7, 2025):
这个pr做了调用其他worker的集成
https://github.com/dreamhunter2333/cloudflare_temp_email/pull/547
@oneisall8955 commented on GitHub (Jan 8, 2025):
已合并 https://github.com/dreamhunter2333/cloudflare_temp_email/pull/547