# DISCOURSE\_SMTP\_AUTHENTICATION setting ignored

**URL:** https://meta.discourse.org/t/discourse-smtp-authentication-setting-ignored/158777
**Category:** Self-hosting
**Created:** [July 25, 2020, 1:34pm UTC](https://meta.discourse.org/t/discourse-smtp-authentication-setting-ignored/158777 "2020-07-25T13:34:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![thfisher](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@thfisher](https://meta.discourse.org/u/thfisher)
#### Post date: [July 25, 2020, 1:34pm UTC](https://meta.discourse.org/t/discourse-smtp-authentication-setting-ignored/158777/1 "2020-07-25T13:34:28Z")

</div>

I have a self-hosted Discourse install and use [socketlabs.com](http://socketlabs.com) as my SMTP server (they have a free plan with 40000. I was unable to get emails to work no matter what authentication protocol I used.

I was able to fix the problem by modifying lib/tasks/emails.rake as follows:

Change the line:  
`Net::SMTP.start(smtp[:address], smtp[:port], 'localhost', smtp[:user_name], smtp[:password])`  
to  
`Net::SMTP.start(smtp[:address], smtp[:port], 'localhost', smtp[:user_name], smtp[:password], smtp[:authentication])`

Without this setting, the lower level SMTP code appears to revert to the default of ‘plain’ authentication.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 2, 2020, 10:47pm UTC](https://meta.discourse.org/t/discourse-smtp-authentication-setting-ignored/158777/2 "2020-08-02T22:47:24Z")

</div>

> [@thfisher](#):
>
> (they have a free plan with 40000

That’s just for the **first month**. After that it’s $40/month.

That said, it would appear (to me, anyway) that this is a legit bug. I think, though, that it affects only this rake task that is used only for testing.
