Hi folks,
I am facing some mail issues with new discourse installation in subdomain. I have gone through the troubleshooting and still have that problem. Essentially, emails from discourse via MailGun do not reach email addresses in my hosting.
Some details of installation environment:
- Hosted in Vultr
- Subdomain in standard hosting
- Using Cloudflare
- Using Mailgun
Other details:
- Emails from Mailgun-Discourse do reach other services (like google mail), and even mail-tester.com without problem.
- Other type of emails reach the recipient (i.e. normal email sent by my GMail address).
- DNS and MX records in Cloudflare set and updated in Mailgun
It is not really important that the emails reach those emails accounts in my hosting (although I wanted to use one of them as admin) but I cam concerned that it might happen also with other self-hosted email addresses.
Header from Failure email:
{
"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 <bounce+f45d38.b55c5c-[username]=[domain]@[subdomain]>\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 <noreply@[discourse subdomain]>",
"subject": "Email Deliverability Test"
},
"attachments": [],
"size": 7127
},
"recipient": "[recipient user]@[recipient-domain]",
"event": "failed"
}
Quoting ticket reply from Mailgun:
The error that you are seeing is the result of sender address verification, and you can read more about it in the following link: Callback verification - Wikipedia. Essentially, this means the recipient domain is performing a check to make sure the sending address is valid.
The following options will help you resolve this error:
- Turn off sender address verification (this is server-side).
- Add “x-mailgun-native-send: true” to the header of your message to turn off sender address rewriting.
- Send from a subdomain of your domain.
- Change the MX records to point to Mailgun instead. ( Warning : do not do this unless you have a Route setup to route back to the internal server.)
- Create a catch_all with the service where you receive email so that, when the recipient server checks, verification it will pass.
Any one has any suggestions on this?
Thanks a lot!
Daniel