# Can't use 'none' DISCOURSE\_SMTP\_AUTHENTICATION

**URL:** https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833
**Category:** Support
**Created:** [January 16, 2017, 12:46pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833 "2017-01-16T12:46:07Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![anthony-o](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anthony-o](https://meta.discourse.org/u/anthony-o)
#### Post date: [January 16, 2017, 12:46pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/1 "2017-01-16T12:46:07Z")

</div>

According to [GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. · GitHub](https://github.com/discourse/discourse/wiki/Global-configuration-options), I should be able to set `DISCOURSE_SMTP_AUTHENTICATION: 'none'` in the `env:` section of my `app.yml` configuration file in order to “completely disable authentication”.

I’m trying to deploy Discourse inside an organization with a private email server which allows to send email from specific IPs internally but requires the applications to disable authentication when talking to it.

When I set `DISCOURSE_SMTP_AUTHENTICATION: 'none'` or `DISCOURSE_SMTP_AUTHENTICATION: none` in my `app.yml`, I obtain those errors in `shared/standalone/log/rails/production.log`:

```plaintext
Sent mail to me@myserver.tld (3.7ms)
Job exception: wrong authentication type none

```

It seems that [I’m not the only one to have this bug](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/217).

---

<div class="post-metadata">

### Author: ![anthony-o](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anthony-o](https://meta.discourse.org/u/anthony-o)
#### Post date: [January 16, 2017, 3:25pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/2 "2017-01-16T15:25:10Z")

</div>

I have also tested to comment `DISCOURSE_SMTP_USER_NAME` setting like [said here](https://meta.discourse.org/t/job-exception-wrong-authentication-type-none/48516/2) without any success (I still have the same error message).

---

<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: [January 16, 2017, 5:21pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/3 "2017-01-16T17:21:39Z")

</div>

I have a very similar setup and use these settings:

```yml
  ## TODO: The mailserver this Discourse instance will use
  DISCOURSE_SMTP_ADDRESS: mail.my.organization.com # (mandatory)
  #DISCOURSE_SMTP_PORT: 587 # (optional)
  #DISCOURSE_SMTP_USER_NAME: user@example.com # (optional)
  #DISCOURSE_SMTP_PASSWORD: pa$$word # (optional)
  DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 16, 2017, 5:34pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/4 "2017-01-16T17:34:57Z")

</div>

Same here. We have no auth set up for email (at least as far as Discourse is concerned).

---

<div class="post-metadata">

### Author: ![anthony-o](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anthony-o](https://meta.discourse.org/u/anthony-o)
#### Post date: [January 16, 2017, 8:18pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/5 "2017-01-16T20:18:57Z")

</div>

And did you (@jomaxro or @fefrei) updated your Discourse instance since November 22, 2016?  
Because @iarwain seems to have [the same problem as me since this date](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/217) and says it was working previously.

The only difference I can see between your configuration and mine is that I did not comment `DISCOURSE_SMTP_PORT`. I will try this tomorrow (hoping that port `25` is the default one).

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 16, 2017, 8:19pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/6 "2017-01-16T20:19:30Z")

</div>

Yes. I’ve updated my instance many times since then - we’re on the absolute latest version of Discourse.

Edit: Let me SSH in and grab my config for you. One moment.

Edit 2: @anthony-o here you go:

```plaintext
## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: mail.rpi.edu # required
DISCOURSE_SMTP_PORT: 25 # (optional, default 587)
#DISCOURSE_SMTP_USER_NAME: *redacted* # required
#DISCOURSE_SMTP_PASSWORD: *redacted* # required, WARNING the char '#' in pw can cause problems!
DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)

```

Note: Our SMTP server _requires_ authentication to work, but because our Discourse instance in on a subdomain which doesn’t have an account that works for mail (mismatch in domains), we got a special IP based exception on the mail server from the postmaster.

---

<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: [January 16, 2017, 8:19pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/7 "2017-01-16T20:19:51Z")

</div>

My Discourse installs closely follow the latest beta.

---

<div class="post-metadata">

### Author: ![iarwain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iarwain/32/121378_2.png) [@iarwain](https://meta.discourse.org/u/iarwain)
#### Post date: [January 16, 2017, 11:27pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/8 "2017-01-16T23:27:14Z")

</div>

I haven’t tinkered with it for a while, I’ll need to try it again with the latest.

Last time I investigated, RoR’s `ActionMailer::Base` would only work [without authentication if its `:authentication` settings field was not defined](http://api.rubyonrails.org/classes/ActionMailer/Base.html). However, if my memory serves me well, Discourse would pass it `:plain` by default when the `DISCOURSE_SMTP_USER_NAME` and `DISCOURSE_SMTP_PASSWORD` were not defined.

Again, I haven’t touched it since mid-November, I’ll check it again in the coming days.

---

<div class="post-metadata">

### Author: ![iarwain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iarwain/32/121378_2.png) [@iarwain](https://meta.discourse.org/u/iarwain)
#### Post date: [January 17, 2017, 12:15am UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/9 "2017-01-17T00:15:37Z")

</div>

I did a try with Discourse 1.3.10 (docker version) and I can confirm it’s now working for me as well, with the same configuration file as before.

---

<div class="post-metadata">

### Author: ![anthony-o](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anthony-o](https://meta.discourse.org/u/anthony-o)
#### Post date: [January 17, 2017, 9:30am UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/10 "2017-01-17T09:30:54Z")

</div>

So here are my tests.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
#DISCOURSE_SMTP_AUTHENTICATION: none
#DISCOURSE_SMTP_PASSWORD: ""
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Here the error is “`Job exception: SMTP-AUTH requested but missing secret phrase`”.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
DISCOURSE_SMTP_AUTHENTICATION: none
#DISCOURSE_SMTP_PASSWORD: ""
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Here the error is “`Job exception: wrong authentication type none`”.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
DISCOURSE_SMTP_AUTHENTICATION: ""
#DISCOURSE_SMTP_PASSWORD: ""
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Here it’s back to “`Job exception: SMTP-AUTH requested but missing secret phrase`”.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
DISCOURSE_SMTP_PORT: 25
DISCOURSE_SMTP_USER_NAME: myusername@server.tld
#DISCOURSE_SMTP_AUTHENTICATION: ""
DISCOURSE_SMTP_PASSWORD: ""
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Same error “`Job exception: SMTP-AUTH requested but missing secret phrase`”.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
#DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
#DISCOURSE_SMTP_AUTHENTICATION: ""
#DISCOURSE_SMTP_PASSWORD: ""
#DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Same error.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
#DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
DISCOURSE_SMTP_AUTHENTICATION: 'none'
#DISCOURSE_SMTP_PASSWORD: ""
#DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Back to “`Job exception: wrong authentication type none`”.

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
#DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
#DISCOURSE_SMTP_AUTHENTICATION: 'none'
DISCOURSE_SMTP_PASSWORD: "none"
#DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Here I’ve got “`Job exception: 504 5.7.4 Unrecognized authentication type`” (that’s at least a reply of the SMTP server I suppose).

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
#DISCOURSE_SMTP_PORT: 25
#DISCOURSE_SMTP_USER_NAME: myusername@server.tld
#DISCOURSE_SMTP_AUTHENTICATION: 'none'
DISCOURSE_SMTP_PASSWORD: "none"
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Same error as last one.

So I’m a bit confused, I think there is really a bug in Discourse that doesn’t support real `none` authentication type.  
@jomaxro, I’m sure that you didn’t defined `DISCOURSE_SMTP_AUTHENTICATION` so `plain` is used, and that means that your SMTP server accepts any authentication (username / password) from the Discourse host, am I wrong?

---

<div class="post-metadata">

### Author: ![anthony-o](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anthony-o](https://meta.discourse.org/u/anthony-o)
#### Post date: [January 17, 2017, 10:49am UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/11 "2017-01-17T10:49:18Z")

</div>

I’ve checked [that other topic](https://meta.discourse.org/t/app-yml-settings-for-internal-smtp-relay/13843/8) and what @NULLpointer suggested doesn’t seem to work anymore (at least, it is not working for me now).  
It seems that @snarke and @homebrewhops had once the same requirement, are you guys up to date with the latest Discourse version and still use a SMTP server without any authentication?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 17, 2017, 11:15am UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/12 "2017-01-17T11:15:39Z")

</div>

> [@anthony-o](#):
>
> @jomaxro, I’m sure that you didn’t defined DISCOURSE\_SMTP\_AUTHENTICATION so plain is used, and that means that your SMTP server accepts any authentication (username / password) from the Discourse host, am I wrong?

OK - so you’re right at the limit of my email knowledge here…if I recall correctly (and there’s no guarantee of that), our SMTP server does not require authentication, however, _something_ will block all email that isn’t properly authenticated (with username/password) or coming from a whitelisted IP.

---

<div class="post-metadata">

### Author: ![anthony-o](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anthony-o](https://meta.discourse.org/u/anthony-o)
#### Post date: [January 17, 2017, 1:01pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/13 "2017-01-17T13:01:35Z")

</div>

At last I’ve managed to make it working!

For my configuration tests I was using the following command:

```plaintext
sudo ./launcher destroy app && sudo ./launcher start app

```

I’ve finally executed the **rebuild** command

```plaintext
sudo ./launcher rebuild app

```

with the following configuration (all other non displayed `DISCOURSE_SMTP_*` parameter were commented)

```plaintext
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
DISCOURSE_SMTP_AUTHENTICATION: none
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none

```

and the mail was finally sent, so I could continue my installation!

---

<div class="post-metadata">

### Author: ![homebrewhops](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/homebrewhops/32/32984_2.png) [@homebrewhops](https://meta.discourse.org/u/homebrewhops)
#### Post date: [January 26, 2017, 6:54pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/14 "2017-01-26T18:54:27Z")

</div>

Thank you @anthony-o!!

The key was: _(all other non displayed DISCOURSE\_SMTP\_ parameter were commented)_\*

```
DISCOURSE_SMTP_ADDRESS: my.smtp.server.tld
DISCOURSE_SMTP_PORT: 25
DISCOURSE_SMTP_AUTHENTICATION: none
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none

```

---

<div class="post-metadata">

### Author: ![jfbourdeau](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jfbourdeau/32/101426_2.png) [@jfbourdeau](https://meta.discourse.org/u/jfbourdeau)
#### Post date: [September 16, 2019, 9:17pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/15 "2019-09-16T21:17:41Z")

</div>

This is an old thread but I am trying to do the same, to force Discourse to not authenticate to send email using a smart host ( Smtp Server accepting Relay from Discourse IP).

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:37pm UTC](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833/16 "2024-06-08T12:37:09Z")

</div>

This topic was automatically closed after 2699 days. New replies are no longer allowed.
