-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
catch all 规则没有获取邮件 #14
Comments
email worker 有报错吗 |
@beilunyang 部署是没有任何问题的 然后我看 cloudflare 里面的 email-receiver-worker 里面访问是显示这样子的 |
你去 dashboard 启用下 email-receiver-worker 的日志功能, 然后看看有没有报错 |
@beilunyang 没有报错,不过还是和之前一样的问题 就是只有我指定特定的邮箱发送到 email-receiver-worker 才能接收到(比如我特定指定了 [email protected]),但是比如我没有指定的邮箱(比如 [email protected]),然后 email-receiver-worker 并没有接收到,所以我怀疑是 catch-all 规则的问题 |
https://community.cloudflare.com/t/the-status-of-the-email-routing-rules-cannot-be-enabled/681051 |
问题描述我新建了一个cloudflare账户,复现了这个问题,默认 Catch-all 规则是禁用的,需要手动点击状态一列的开关,来启用。但由于cloudflare 的 bug,状态一列一直显示 loading, 无法显示启用开关,导致无法启用 Catch-all 规则。 解决方法Cloudflare 有 提供 API , 可以不通过 dashboard 界面来启用 Catch-all 规则。API 文档: 我写了个脚本,填写参数,运行即可 import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: '<具有Email Routing Rules 编辑权限的 API_TOKEN>',
});
const emailRoutingRule = await client.emailRouting.rules.catchAlls.update('<你的ZONE_ID>', {
actions: [{ type: 'worker', value: ['email-receiver-worker'] }],
matchers: [{ type: 'all' }],
enabled: true,
name: 'Catch-all rule',
});
console.log(emailRoutingRule); |
成功了!!大佬太强了👍 感谢大佬 @beilunyang |
大佬,大佬,这个参数怎么写,我有点理解不了,然后这个在哪运行,我不清楚,我是小白@beilunyang |
我已经在我的个人域名上部署好了 :https://mail.limingjie.us.kg 欢迎大家注册😀
但是我测试的时候发现了,catch all 并没有获取到邮件,随后我便在 cloudflare 中设置了自定义规则路由(如下图),发现这样才能捕获到。
捕获成功的样子⬇️
但是这样注册的每个邮箱都得添加规则,有点麻烦,不知道是不是我配置的原因还是 cloudflare 本身的原因,catch all 没有捕获到我新建的邮箱
The text was updated successfully, but these errors were encountered: