# Emails not getting signed by DKIM when sent using discourse

**URL:** https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762
**Category:** Self-hosting
**Tags:** email
**Created:** [May 4, 2024, 10:18pm UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762 "2024-05-04T22:18:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![o\_o1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/o_o1/32/383750_2.png) [@o\_o1](https://meta.discourse.org/u/o_o1)
#### Post date: [May 4, 2024, 10:18pm UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/1 "2024-05-04T22:18:06Z")

</div>

I have discourse installed on VPS  
I have directadmin installed on a different managed VPS running exim smtp

In discourse I used SMTP server details on the directadmin VPS

I checked emails with [isnotspam.com](http://isnotspam.com)

## **Sending email using thunderbird with directadmin SMTP**

```plaintext
Result: pass
ID(s) verified: [header.From=discourse@example.com](mailto: header.From=discourse@example.com)
Selector=x
domain=example.com
DomainKeys DNS Record=x._domainkey.example.com

```

**BUT if I send it out using discourse the result passes, but no selector**

```plaintext
Result: pass
ID(s) verified: [header.From=discourse@example.com](mailto :header.From=discourse@example.com)
Selector=
domain=
DomainKeys DNS Record=._domainkey.

```

Any ideas?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [May 4, 2024, 10:49pm UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/2 "2024-05-04T22:49:05Z")

</div>

Which component are you expecting to be doing the DKIM signing?

---

<div class="post-metadata">

### Author: ![o\_o1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/o_o1/32/383750_2.png) [@o\_o1](https://meta.discourse.org/u/o_o1)
#### Post date: [May 5, 2024, 6:25am UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/3 "2024-05-05T06:25:18Z")

</div>

My SMTP server should.

However when emails are sent from discourse it’s not getting signed the same.

I’m wondering if it has to do with the helo [forum.example.com](http://forum.example.com)

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [May 5, 2024, 6:41am UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/4 "2024-05-05T06:41:47Z")

</div>

You gave the answer yourself 🕶 Discourse acts as an smtp client and the dkim signing must be provided by the smtp server receiving the mails from Discourse.

---

<div class="post-metadata">

### Author: ![o\_o1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/o_o1/32/383750_2.png) [@o\_o1](https://meta.discourse.org/u/o_o1)
#### Post date: [May 5, 2024, 6:51am UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/5 "2024-05-05T06:51:41Z")

</div>

> [@Thomas\_Rother](#):
>
> Discourse acts as an smtp client

Yes correct.

So the different signing results when checked with isnotspam was confusing me.

* * *

Anyway , I re ran the test today and now it passes

–

```plaintext
----------------------------------------------------------
DKIM check details:
----------------------------------------------------------

Result: pass
ID(s) verified: header.From=discourse@example.com
Selector=x
domain=example.com
DomainKeys DNS Record=x._domainkey.example.com

```

* * *

Not sure what happened, but I did have to update my DNS txt key inside cloudflare, as well as update the rDNS for the mail server.

Maybe it just required time for everything to propagate or clear some cache?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [May 6, 2024, 10:48pm UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/6 "2024-05-06T22:48:41Z")

</div>

> [@o\_o1](#):
>
> Anyway , I re ran the test today and now it passes

In the previous test:

```plaintext
Result: pass
ID(s) verified: [header.From=discourse@example.com](mailto :header.From=discourse@example.com)
Selector=
domain=
DomainKeys DNS Record=._domainkey.

```

there was no DKIM record, so it wasn’t signed.

> [@o\_o1](#):
>
> Maybe it just required time for everything to propagate or clear some cache?

DNS doesn’t propagate, remember.

Regardless, now the mail is signed so you should be good?

---

<div class="post-metadata">

### Author: ![o\_o1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/o_o1/32/383750_2.png) [@o\_o1](https://meta.discourse.org/u/o_o1)
#### Post date: [May 7, 2024, 7:14am UTC](https://meta.discourse.org/t/emails-not-getting-signed-by-dkim-when-sent-using-discourse/306762/7 "2024-05-07T07:14:04Z")

</div>

Yep its signs on checking, so something needed cache updating
