# Email failure after install

**URL:** https://meta.discourse.org/t/email-failure-after-install/145315
**Category:** Self-hosting
**Created:** [March 23, 2020, 10:16pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315 "2020-03-23T22:16:32Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sturdy2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sturdy2/32/138218_2.png) [@sturdy2](https://meta.discourse.org/u/sturdy2)
#### Post date: [March 23, 2020, 10:16pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315/1 "2020-03-23T22:16:32Z")

</div>

I have installed Discourse and now have admin access but when I try send invitations or test emails, total failure.

I have an email server ([mail.mydomain.com](http://mail.mydomain.com)) with the account [postmaster@mydomain.com](mailto:postmaster@mydomain.com). After reading several of the support questions and answers it appears [mydomain.com](http://mydomain.com) may require SPF and DKIM DNS records. Did I miss this in the installation instructions?

I found and tested the SPF record and that appears okay.  
I can send email from my personal email to postmaster@mydomain and it is received okay.

If I send a test email from my Discourse, it is not received. Is a DKIM required? If so, how do I install the DKIM? Again, did I miss this step somewhere?

TIA…

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 23, 2020, 11:52pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315/2 "2020-03-23T23:52:08Z")

</div>

SPF and DKIM shouldn’t be preventing outgoing mail from going from Discourse to your mail server. Check the `/logs` on your forum and the logs of the mail server for any error messages.

---

<div class="post-metadata">

### Author: ![danb35](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@danb35](https://meta.discourse.org/u/danb35)
#### Post date: [March 24, 2020, 1:50am UTC](https://meta.discourse.org/t/email-failure-after-install/145315/3 "2020-03-24T01:50:29Z")

</div>

> [@sturdy2](#):
>
> may require SPF and DKIM DNS records. Did I miss this in the installation instructions?

Any documentation of those would come from your email provider, as there’s no one way to set them up. But as noted, it’s extremely unlikely that this is the cause of your delivery failures.

---

<div class="post-metadata">

### Author: ![sturdy2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sturdy2/32/138218_2.png) [@sturdy2](https://meta.discourse.org/u/sturdy2)
#### Post date: [March 24, 2020, 9:27pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315/4 "2020-03-24T21:27:17Z")

</div>

Thanks to all. Sorry for the delay. It seems that outgoing email tests land in a black hole. I now understand that SPF and DKIM records should not be required. Here is what I now see when logged in as admin:

/emails/settings I enter any (mine or an invited user; host domain or not) email address and I get this error msg:

> There was a problem sending the test email. Please double-check your mail settings, verify that your host is not blocking mail connections, and try again.

As I understand the email settings in Discourse, I think they are correct but I have seen no real definition. Host domain is not blocking because I can send an email from my personal address. I checked UFW of Discourse droplet and it reports disabled.

/logs/error logs is blank. An obvious error (above) but it didn’t log! Log all email processing failures to [/logs] is true (checked). I find no error at host domain.

In addition, I have a WP site with [WP Discourse](https://github.com/discourse/wp-discourse) plugin installed but not activated. Might this plugin help somehow?

TIA

Edit…  
I returned to Dashboard and saw this:

`There are 7 email jobs that failed. Check your app.yml and ensure that the mail server settings are correct. [See the failed jobs in Sidekiq](https://talk.thesturdytree.com/sidekiq/retries)`

I clicked Sidekiq and I see 7 entries which are duplicates of these"

`[in 3 hours](https://talk.thesturdytree.com/sidekiq/retries/1585096899.6700559-58d9041788be7dd98d743894) 15 [default](https://talk.thesturdytree.com/sidekiq/queues/default) Jobs::InviteEmail {"invite_id"=>2, "current_site_id"=>"default"} Jobs::HandledExceptionWrapper: Wrapped Net::ReadTimeout: Net::ReadTimeout with #<TCPSocket:(closed)>`

`[in 3 hours](https://talk.thesturdytree.com/sidekiq/retries/1585097052.665957-fc6f06d948e7d37ec15354cc) 15 [critical](https://talk.thesturdytree.com/sidekiq/queues/critical) Jobs::CriticalUserEmail {"type"=>"email_login", "user_id"=>1, "email_token"=>"da467ec8590f0ecb0220d3aed5b33c61", "current_site_id"=>"default"} Jobs::HandledExceptionWrapper: Wrapped Net::ReadTimeout: Net::ReadTimeout with #<TCPSocket:(closed)>`

That admin dashboard page also says “You’re up to date!” but when I ssh into the droplet, I’m told that “55 packages can be updated.” Does this require some action?

---

<div class="post-metadata">

### Author: ![danb35](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@danb35](https://meta.discourse.org/u/danb35)
#### Post date: [March 24, 2020, 11:09pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315/5 "2020-03-24T23:09:27Z")

</div>

> [@sturdy2](#):
>
> That admin dashboard page also says “You’re up to date!” but when I ssh into the droplet, I’m told that “55 packages can be updated.”

Orthogonal issues. The admin dashboard tells you that Discourse itself is up to date. The message on login to the droplet tells you that there’s system software that can be updated. You should probably investigate how to set up automated updates for this system.

> [@sturdy2](#):
>
> Wrapped Net::ReadTimeout: Net::ReadTimeout with #TCPSocket:(closed)

This sounds like your Discourse instance isn’t able to connect to the specified mail server on the specified port. Make sure your configuration is correct, and that DO doesn’t block outbound connections on the port you’re trying to use.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 25, 2020, 4:41am UTC](https://meta.discourse.org/t/email-failure-after-install/145315/6 "2020-03-25T04:41:01Z")

</div>

> [@danb35](#):
>
> You should probably investigate how to set up automated updates for this system.

[https://github.com/discourse/discourse/blob/master@{2020-03-24}/docs/INSTALL-cloud.md#post-install-maintenance](https://github.com/discourse/discourse/blob/master@%7B2020-03-24%7D/docs/INSTALL-cloud.md#post-install-maintenance)

In Ubuntu use the `dpkg-reconfigure -plow unattended-upgrades` command.

---

<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: [March 25, 2020, 6:49am UTC](https://meta.discourse.org/t/email-failure-after-install/145315/7 "2020-03-25T06:49:53Z")

</div>

> [@sturdy2](#):
>
> `Check your app.yml and ensure that the mail server settings are correct.`

Suggestions, in logical order of execution:

1. Verify that your droplet can connect to the mail server via telnet
2. Verify that the SMTP credentials are functioning independent of the droplet

If 1 fails then you have a network issue, DigitalOcean has been known to block certain outbound ports, and this is the issue 85% of the time.

If both 1 and 2 works then check your app.yml, it’s likely the password either includes a character which is preventing it from being parsed properly (~5% of the time), or you didn’t enter it correctly.

Re the mail server, if you’re hosting a mail server rather than using one of the recommended mail providers then SPF and DKIM can definitely help with deliverability, but you’re likely to be at the tip of the iceberg in terms of mail problems.

---

<div class="post-metadata">

### Author: ![sturdy2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sturdy2/32/138218_2.png) [@sturdy2](https://meta.discourse.org/u/sturdy2)
#### Post date: [March 25, 2020, 10:46pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315/8 "2020-03-25T22:46:40Z")

</div>

Thanks to all for the assistance.  
I think the problem was my email server provided by GoDaddy. I never did identify the cause of problem. It seems that GoDaddy has a lot of issues with shared accounts. Ultimately, I decided it wasn’t worth the hassle and searched for recommended email providers and selected [mailjet.com](http://mailjet.com). I opened a mailjet free account and edited app.yml, accordingly. Some additional mailjet config was required. Again, tried the Discourse email test: success. My Discourse community is small so there should be no problem with limited free emails by mailjet. All looks good at this point but I can see there is stilll a lot of configuration ahead.  
Thanks again…

---

<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: [April 24, 2020, 10:46pm UTC](https://meta.discourse.org/t/email-failure-after-install/145315/9 "2020-04-24T22:46:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
