# Registration and Test Emails constantly going to Spam via Mailgun

**URL:** https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073
**Category:** Self-hosting
**Created:** [1월 21, 2019, 8:06오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073 "2019-01-21T08:06:35Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 8:06오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/1 "2019-01-21T08:06:35Z")

</div>

We’re using DigitalOcean for our discourse community and mailgun as mail server on `community.biafland.com`. Everything is configured correctly and after testing the email on [mail-tester.com](http://mail-tester.com) we got 10/10 result. But the problem is all the registration and test emails are going to spam folder. After troubleshooting everything we don’t have any idea what’s causing the issue and we did all whatever we can do.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [1월 21, 2019, 8:26오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/2 "2019-01-21T08:26:13Z")

</div>

First thing to check is the reputation of IP address that mailgun assigned you.

If that is all good then you may consider revisiting your DNS records.

I tried registering with a [mail-tester.com](http://mail-tester.com) email to test. Here are the results and they don’t look good!  
[Spam Test Result](https://www.mail-tester.com/test-zjqfh)

More suspicion! Your sender address is a Gmail address and I remember you said you’re using mailgun! why are you sending mails from gmail address? that’ll never work and it’s against the gmail policies.

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 8:35오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/3 "2019-01-21T08:35:26Z")

</div>

Yeah, while testing I changed the contact and notification email to a gmail ID but its now changed to `noreply@community.biafland.com`. That’s why you got a worst result. But earlier I got 10/10 using the email `noreply@community.biafland.com`. Checkout the results here now [https://www.mail-tester.com/test-rgwxx](https://www.mail-tester.com/test-rgwxx).

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/5/5584dbae5d5cd8067158725633aed29f9112639d.png)

And here’s the IP reputation check result: [https://www.talosintelligence.com/reputation\_center/lookup?search=209.61.151.224](https://www.talosintelligence.com/reputation_center/lookup?search=209.61.151.224)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [1월 21, 2019, 8:56오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/4 "2019-01-21T08:56:21Z")

</div>

Try contacting mailgun support for delivery issues.

Also, You can consider [Postmaster Tools – Google](https://gmail.com/postmaster)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 21, 2019, 9:00오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/5 "2019-01-21T09:00:23Z")

</div>

Good work being thorough with mail-tester which is a great service.

However, did you check the IP address _that the mail is being sent from?_ That is, mailgun’s provided IP?

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 9:02오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/6 "2019-01-21T09:02:18Z")

</div>

Yes, following @itsbhanusharma recommendation I’ve checked IP reputation of the mailgun IP and here’s the report: [https://www.talosintelligence.com/reputation\_center/lookup?search=209.61.151.224.](https://www.talosintelligence.com/reputation_center/lookup?search=209.61.151.224.)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 21, 2019, 9:07오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/7 "2019-01-21T09:07:57Z")

</div>

You are right that looks clean.

If you’ve ruled out the mail sending IP, and mail-tester is _also_ showing 10/10 ..

The only answer at this point is your domain name has somehow been flagged as spam, because that’s the only unique content in the emails.

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 9:11오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/8 "2019-01-21T09:11:14Z")

</div>

@codinghorror Any recommendation to get rid of unflagging the domain and how to check it? Also, one of the user was able to receive registration confirmation email through gmail ID. May be somehow I’m getting all emails to spam due to my IP issue? Can you try registering from your end using a gmail ID and check if its working there?

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 9:23오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/9 "2019-01-21T09:23:06Z")

</div>

I did already. Here’s what Mailgun support replied finally.

Unfortunately, Mailgun cannot troubleshoot email delivery once Mailgun has successfully delivered the messages to the recipient email server. Whenever a “delivered” event occurs in the logs, this means that the recipient server has accepted the message from Mailgun and returned a “Success” message back to Mailgun. Therefore, we are unable to track what happens to a message once we hand the message off and receive this response.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 21, 2019, 9:27오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/10 "2019-01-21T09:27:56Z")

</div>

You will need to follow up with Google, unfortunately… good luck with that.

It might be easier to change your domain name, to be honest.

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 9:30오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/11 "2019-01-21T09:30:05Z")

</div>

Its a bad news ☹ Are you sure there’s no issues with DigitalOcean and MailGun?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [1월 21, 2019, 9:32오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/12 "2019-01-21T09:32:27Z")

</div>

Can you find the mail headers at gmail and try to find out what is the reason for the mail being marked as spam?

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 11:12오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/13 "2019-01-21T11:12:02Z")

</div>

[original\_msg.txt](https://global.discourse-cdn.com/meta/original/3X/1/5/15eb705004fedc05f146eb8ed63dd62f74f53fa3.txt) (60.6 KB)

Here’s the original message so you can have a look. I’m not sure what to check on header to find out an issue.

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 11:29오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/14 "2019-01-21T11:29:09Z")

</div>

I just did a test here: [https://app.glockapps.com](https://app.glockapps.com) and found mailgun is the reason for why email is going to spam. It shows sendgrid emails sent directly to inbox to 4 major emails like gmail, outlook, yahoo, office 365, hotmail and amazon workmail.

Do you guys suggest to test with sendgrid?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 21, 2019, 11:34오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/15 "2019-01-21T11:34:31Z")

</div>

Excellent research. Switching mail services is probably easier than switching your domain name, but we have used Mailgun in the past without deliverability issues, so this is not a systemic problem that I’m aware of.

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 11:42오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/16 "2019-01-21T11:42:09Z")

</div>

Thank you! I understand Mailgun is reputed and I’ve been trying to stick with them. What could be the reason of this issue? Is that can be solved with a dedicated IP on Mailgun?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [1월 21, 2019, 11:44오전 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/17 "2019-01-21T11:44:28Z")

</div>

I don’t personally think the situation is as extreme as getting to buy a dedicated IP. maybe try asking them to just assign you to a different IP (I really doubt that’d help as sending IP’s reputation is fine. )

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 8:52오후 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/18 "2019-01-21T20:52:58Z")

</div>

Thanks to you guys for helping me out. Finally, we solved the email delivery with Sparkpost and removed Mailgun 🙂

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [1월 21, 2019, 9:03오후 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/19 "2019-01-21T21:03:44Z")

</div>

Did you look at the header of an email that went to spam?

Mailgun won’t have been the issue and it’s impossible to look at your configuration to find where it was breaking down now that you’ve moved, but the header should include the proverbial smoking gun.

---

<div class="post-metadata">

### Author: ![aronno755](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aronno755](https://meta.discourse.org/u/aronno755)
#### Post date: [1월 21, 2019, 9:58오후 UTC](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073/20 "2019-01-21T21:58:48Z")

</div>

Actually, I don’t know what was the issue with Mailgun configuration and but I did everything right and got 10/10 score on [mail-tester.com](http://mail-tester.com). You can check the current email header and I’ve uploaded earlier mailgun email header on this thread to compare: [Registration and Test Emails constantly going to Spam via Mailgun - #13 by aronno755](https://meta.discourse.org/t/registration-and-test-emails-going-to-spam/107073/13)

If you can help me to figure out then it will be a experiment to me and all others to get the right place fixing the header or other configuration.

[다음 페이지](https://meta.discourse.org/t/registration-and-test-emails-constantly-going-to-spam-via-mailgun/107073.md?page=2)
