550 验证失败“无此用户”(回调验证)

大家好,
我在子域名的新 Discourse 安装中遇到了一些邮件问题。我已经查阅了故障排除指南,但问题依然存在。本质上,通过 MailGun 从 Discourse 发出的邮件无法送达我托管环境中的邮箱地址

安装环境的一些细节:

  • 托管在 Vultr
  • 子域名位于标准托管环境中
  • 使用 Cloudflare
  • 使用 Mailgun

其他细节:

  • 来自 Mailgun-Discourse 的邮件可以正常送达其他服务(如 Gmail),甚至 mail-tester.com 也没有问题。
  • 其他类型的邮件可以正常送达收件人(例如,我通过 Gmail 发送的普通邮件)。
  • Cloudflare 中的 DNS 和 MX 记录已设置并在 Mailgun 中更新。

邮件无法送达我托管环境中的邮箱账户其实并不重要(尽管我想将其中一个用作管理员账户),但我担心这可能也会发生在其他自托管邮箱地址上。

失败邮件的头部信息如下:

{
    "severity": "permanent",
    "tags": [],
    "storage": {
        "url": "https://sw.api.mailgun.net/v3/domains/[subdomain here]messages/eyJwIjpmYWxzZSwiayI6IjgwYzAzNzQ2LTN.........",
        "key": "eyJwIjp...."
    },
    "delivery-status": {
        "mx-host": "dc-94c828295f73.[domain here[",
        "attempt-no": 1,
        "description": "",
        "session-seconds": 0.5889058113098145,
        "code": 550,
        "message": "Verification failed for \u003cbounce+f45d38.b55c5c-[username]=[domain]@[subdomain]\u003e\nNo Such User Here\nSender verify failed"
    },
    "recipient-domain": "[domain here]",
    "id": "DSLvcNXnTEKYl7gsFOGkDg",
    "campaigns": [],
    "reason": "generic",
    "user-variables": {},
    "flags": {
        "is-routed": false,
        "is-authenticated": true,
        "is-system-test": false,
        "is-test-mode": false
    },
    "log-level": "error",
    "timestamp": 1535055760.1404,
    "envelope": {
        "transport": "smtp",
        "sender": "noreply@[subdomain]",
        "sending-ip": "184.173.153.194",
        "targets": "[user]@[domain]"
    },
    "message": {
        "headers": {
            "to": "[recipient user]@[recipient-domain]",
            "message-id": "e438348c-9414-48e8-8af3-25df2174d5f7@[discourse subdomain]",
            "from": "Discourse \u003cnoreply@[discourse subdomain]\u003e",
            "subject": "Email Deliverability Test"
        },
        "attachments": [],
        "size": 7127
    },
    "recipient": "[recipient user]@[recipient-domain]",
    "event": "failed"
}

引用 Mailgun 工单回复中的内容:

您遇到的错误是发件人地址验证的结果,您可以在以下链接中了解更多相关信息:http://en.wikipedia.org/wiki/Callback_verification。本质上,这意味着收件人域名正在执行检查,以确认发件人地址是否有效。

以下选项将帮助您解决此错误:

  1. 关闭发件人地址验证(这是在服务器端进行的)。
  2. 在邮件头部添加 “x-mailgun-native-send: true” 以关闭发件人地址重写。
  3. 从您域名的子域名发送邮件。
  4. 将 MX 记录指向 Mailgun。(警告:除非您已设置路由以将邮件路由回内部服务器,否则请勿执行此操作。)
  5. 在您接收邮件的服务中创建一个 catch_all,以便当收件人服务器进行检查时,验证能够通过。

对此,大家有什么建议吗?

非常感谢!

Daniel

I see that you have enabled cloudflare on your mx records as well!

Can you try again by disabling cloudflare on your mx domain/subdomain?

I Noticed your forum runs on http not https is there a purpose for that?

Right… So it looks like it is fixed now…
Just for future reference from someone having this problem, I just went to cPanel > Email Routing, and for the subdomain I am using for Discourse (and thus the subdomain Mailgun generates the postmaster/no-reply emails) I chose “Remote Mail Exchanger” and click on “Change”
Seems to work now with all emails… :roll_eyes:

Hi Bhanu,
Thanks for your reply. See below, looks like I managed to sort it out.
Re: SSL, because Let’sEncrypt+Cloudflare was a nightmare to set up for the main site, I am using Cloudflare’s shared certificated for the main site. Not sure how to manage it with Cloudflare + Ubuntu, hence why no HTTPS. If you have any links I can look at, that’d be amazing!
Kind Regards,
Daniel

Just disable cloudflare optimization for your forum subdomain and it should in theory be able to generate ssl for you.