# Troubleshooting spam issue with SendGrid - email notifications arriving in junk folders

**URL:** https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815
**Category:** Support
**Tags:** email
**Created:** [August 18, 2016, 3:53pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815 "2016-08-18T15:53:44Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 18, 2016, 3:53pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/1 "2016-08-18T15:53:44Z")

</div>

Hi,

I have discourse set up with SendGrid, and most users are experiencing issues with notifications from the forum going into spam/junk folders. I have SPF, DKIM and DMARC records set up on my server.

I think the issue is related to SendGrid, but I’m not sure. I am wondering if there is a way of manually sending emails from discourse to junk/spam checking services such as _Is Not Spam_, _SpamScoreChecker_, etc. I suppose I could add new users using the email addresses linked to these services, create a group for these users, and then post content in this group, but I am wondering if there is a simpler way?

I am also wondering about people’s experience of SendGrid and whether I need to be looking to another service?

Thanks,

Nick

---

<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: [August 18, 2016, 7:17pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/2 "2016-08-18T19:17:39Z")

</div>

Try using [http://mail-tester.com](http://mail-tester.com) to see.

One thing I found is that sometimes you have to pay for a dedicated IP: if you happen to be sharing that IP with someone who is sending real spam, you are totally screwed.

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 18, 2016, 7:32pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/3 "2016-08-18T19:32:08Z")

</div>

Thanks Jeff. Yes, [http://mail-tester.com](http://mail-tester.com) is a service I have used before.

I have a dedicated IP, with the correct mail settings, which is what leads me to wonder if the issue is related to SendGrid.

I am wondering whether there is a facility within discourse where I can send a test email to Mail Tester, or whether I have to create a user account with the temporary Mail Tester email address?

---

<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: [August 18, 2016, 7:48pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/4 "2016-08-18T19:48:41Z")

</div>

Yes, simply go to Admin, Emails, send test email.. it’s right there.

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 18, 2016, 8:29pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/5 "2016-08-18T20:29:26Z")

</div>

Thanks - that works well. I got an 8/10 score on Mail Tester.

The two issues are as follows:

```
-1.084	URIBL_GREY	Contains an URL listed in the URIBL greylist
URIs: sendgrid.net
You can request to be removed from the URIBL greyest

```

Which would seem to suggest that sendgrid doesn’t have a great reputation.

and…

```
[Sender ID] forum.open-dialogue.net does not allow your server 167.89.55.59 to use noreply@forum.open-dialogue.net
Sender ID is like SPF, but it checks the FROM address, not the bounce address.
You do not have a SPF record, please add the following one to your domain forum.open-dialogue.net:

v=spf1 a mx include:sendgrid.net ~all

```

I have added this SPF record to my primary domain [open-dialogue.net](http://open-dialogue.net), but I am not sure how to do so for the subdomain [forum.open-dialogue.net](http://forum.open-dialogue.net).

Do you have any suggestions?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 18, 2016, 11:15pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/6 "2016-08-18T23:15:59Z")

</div>

SPF records work exactly the same no matter where in the hierarchy they live. Put an SPF or appropriately-formatted TXT record on `forum.open-dialogue.net`.

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 19, 2016, 9:13am UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/7 "2016-08-19T09:13:02Z")

</div>

Thanks Matt. I have tried to do this in the settings for my domain on Digital Ocean. I have entered the following TXT record under the domain [open-dialogue.net](http://open-dialogue.net):

Name: [forum.open-dialogue.net](http://forum.open-dialogue.net)  
Text: v=spf1 a mx include:sendgrid.net ~all

But I am still getting the same message on Mail Tester.

I am not sure if this is because I need to wait for my DNS to update, or because I have not entered the settings correctly.

Can you advise further?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 19, 2016, 9:39am UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/8 "2016-08-19T09:39:07Z")

</div>

I’m not seeing the DNS record in place, and neither is Google:

```plaintext

$ dig forum.open-dialogue.net txt

; <<>> DiG 9.9.5-9+deb8u6-Debian <<>> forum.open-dialogue.net txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48159
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;forum.open-dialogue.net. IN TXT

;; AUTHORITY SECTION:
open-dialogue.net. 1763 IN SOA ns1.digitalocean.com. hostmaster.open-dialogue.net. 1471553742 10800 3600 604800 1800

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Aug 19 19:37:36 AEST 2016
;; MSG SIZE rcvd: 119

$ dig @8.8.8.8 forum.open-dialogue.net txt

; <<>> DiG 9.9.5-9+deb8u6-Debian <<>> @8.8.8.8 forum.open-dialogue.net txt
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6223
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;forum.open-dialogue.net. IN TXT

;; AUTHORITY SECTION:
open-dialogue.net. 1799 IN SOA ns1.digitalocean.com. hostmaster.open-dialogue.net. 1471553742 10800 3600 604800 1800

;; Query time: 311 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Aug 19 19:37:51 AEST 2016
;; MSG SIZE rcvd: 119

```

Similarly, a cache-skipping `+trace` run doesn’t show it, so time to go back and double-check that record, and perhaps get in DO’s ear if you can’t see what’s wrong.

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 19, 2016, 11:53pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/9 "2016-08-19T23:53:42Z")

</div>

I have sorted the issue with the SPF record - I simply had to use ‘forum’ as the name of the TXT record. I am currently getting a score of 8.9/10, with the primary issue being URIBL greylist as mentioned above, which seemingly I can’t do anything about.

There are a couple of other minor issues which don’t seem to affect the score but which have been flagged by Mail Tester, and I’m wondering if I can do anything about these?

Firstly:

```
Your domains are not aligned. We can't check DMARC.
A DMARC policy allows a sender to indicate that their emails are protected by SPF and/or DKIM, and give instruction if neither of those authentication methods passes. Please be sure you have a DKIM and SPF set before using DMARC.
Before using DMARC, you should make sure the domains used in the Envelope From (e.g., Return-Path or Mail-From), the "Friendly" From (i.e., "Header" From) and the d=domain in the DKIM-Signature are the same
DMARC DNS entry found for the domain _dmarc.forum.open-dialogue.net:

"v=DMARC1; p=none"
Verification details:

mail-tester.com; dmarc=none header.from=forum.open-dialogue.net
mail-tester.com;	dkim=pass (1024-bit key; unprotected) header.d=sendgrid.net header.i=@sendgrid.net header.b=BdpIOUIj;	dkim-atps=neutral
From Domain: forum.open-dialogue.net
DKIM Domain: sendgrid.net

```

Then:

```
Weight of the HTML version of your message: 8KB.

Your message contains 22% of text.

```

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 21, 2016, 5:14pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/10 "2016-08-21T17:14:15Z")

</div>

Also, a fairly simple question - should asking users to add **[noreply@forum.open-dialogue.net](mailto:noreply@forum.open-dialogue.net)** to their safe senders list (and/or marking emails from this address as not junk/spam) be enough to ensure that all emails lands in inboxes?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 21, 2016, 11:13pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/11 "2016-08-21T23:13:05Z")

</div>

The only guarantee when it comes to mail delivery is that there are no guarantees. Asking people to whitelist your sending address or doing anything else in their mail client _might_ help, but every mail recipient service treats those signals differently.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [August 22, 2016, 12:54pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/12 "2016-08-22T12:54:36Z")

</div>

> [@Nick\_Putman](#):
>
> -1.084 URIBL\_GREY Contains an URL listed in the URIBL greylist  
> URIs: [sendgrid.net](http://sendgrid.net)

Did you [enable click tracking in your sendgrid configuration](https://sendgrid.com/docs/User_Guide/Settings/tracking.html)? If so, that is probably what is causing your forum URLs to be re-written as [sendgrid.net](http://sendgrid.net) URLs. Try with the tracking disabled and see if that helps improve your score.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [August 22, 2016, 3:09pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/13 "2016-08-22T15:09:07Z")

</div>

Actually, there always is a Sendgrid link in the test email – so please _do_ check that you disabled click tracking, but doing so will not eliminate the warning in [mail-tester.com](http://mail-tester.com).

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 22, 2016, 3:57pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/14 "2016-08-22T15:57:54Z")

</div>

> [@wesochuck](#):
>
> Did you enable click tracking in your sendgrid configuration?

I think that was enabled by default. Now that I have disabled it, it does appear to have removed the URIBL\_GREY score. However there are now other issues being reported. The main one affecting the score is this:

`-1.729	RAZOR2_CHECK	Listed in Razor2 (http://razor.sf.net/)`

It seems like RAZOR2\_CHECK scores are based on an analysis of the content of the email, rather than having anything to do with the sender - is there any way of addressing this?

There are also a couple of other more minor issues:

```
-0.276	URIBL_RHS_DOB	Contains an URI of a new domain (Day Old Bread)
URIs: open-dialogue.net

```

and

`Weight of the HTML version of your message: 3KB. Your message contains 63% of text.`

and finally

`Your message does not contain a List-Unsubscribe header`

Is there anything that can be done about any of these issues?

---

<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: [August 22, 2016, 11:00pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/15 "2016-08-22T23:00:11Z")

</div>

> [@fefrei](#):
>
> there always is a Sendgrid link in the test email

No, there is not – funnily enough I converted it to a goo.gl redirected link a month or so ago because of this exact issue 😉

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [August 22, 2016, 11:03pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/16 "2016-08-22T23:03:35Z")

</div>

> [@Nick\_Putman](#):
>
> Your message does not contain a List-Unsubscribe header

Is that error specifically referring to the test e-mail? If so, that’s fine – we just did a round of “add List-Unsub to everywhere” changes, so as long as you’re running up-to-date code, every _real_ e-mail should have the header set appropriately.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [August 23, 2016, 4:53am UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/17 "2016-08-23T04:53:56Z")

</div>

> [@codinghorror](#):
>
> funnily enough I converted it to a goo.gl redirected link a month or so ago because of this exact issue 😉

I even thought of that possibility before posting, and decided not to check 😊

As a believer of Murphy’s Law, now I’m sure that you hadn’t done that change before I posted, but my posting created a ripple in space-time that allowed you to travel back in time and correct this one month ago 😃

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 23, 2016, 1:56pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/18 "2016-08-23T13:56:54Z")

</div>

> [@mpalmer](#):
>
> Is that error specifically referring to the test e-mail?

Yes, its specifically referring to test email - good to know that this isn’t an issue with real emails.

---

<div class="post-metadata">

### Author: ![Nick\_Putman](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@Nick\_Putman](https://meta.discourse.org/u/Nick_Putman)
#### Post date: [August 23, 2016, 2:00pm UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/19 "2016-08-23T14:00:47Z")

</div>

> [@Nick\_Putman](#):
>
> -1.729 RAZOR2\_CHECK Listed in Razor2 ([http://razor.sf.net/](http://razor.sf.net/))

Any ideas about this? It wasn’t appearing in spam test reports a couple of days ago, but now is. Are others seeing this entry in spam test checks?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 26, 2019, 10:30am UTC](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815/20 "2019-02-26T10:30:21Z")

</div>



[Next page](https://meta.discourse.org/t/troubleshooting-spam-issue-with-sendgrid-email-notifications-arriving-in-junk-folders/48815.md?page=2)
