# Installing Discourse with digest\_md5 mail authentication

**URL:** https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974
**Category:** Self-hosting
**Tags:** email
**Created:** [April 14, 2017, 8:05am UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974 "2017-04-14T08:05:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![vmassol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vmassol/32/70740_2.png) [@vmassol](https://meta.discourse.org/u/vmassol)
#### Post date: [April 14, 2017, 8:05am UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974/1 "2017-04-14T08:05:26Z")

</div>

Hi,

We’re trying to setup Discourse and are having problems setting up the mail part. Our mail server only supports digest\_md5 and we’re trying to make Discourse use that authentication.

We found that Discouse uses [ActionMailer::Base](http://api.rubyonrails.org/classes/ActionMailer/Base.html) to send mails and that this mailer support 3 authentication methods:

> :authentication - If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of :plain (will send the password Base64 encoded), :login (will send the password Base64 encoded) or :cram\_md5 (combines a Challenge/Response mechanism to exchange information and a cryptographic Message Digest 5 algorithm to hash important information)

So: plain, login et cram\_md5

Is there a way to have Discourse authenticate against a mail server accepting digest\_md5?

Thanks

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 14, 2017, 9:18am UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974/2 "2017-04-14T09:18:36Z")

</div>

I think “`login`” is what you’re looking for. Have you tried that?

---

<div class="post-metadata">

### Author: ![kevinwaro](https://avatars.discourse-cdn.com/v4/letter/k/ea666f/32.png) [@kevinwaro](https://meta.discourse.org/u/kevinwaro)
#### Post date: [April 14, 2017, 10:08am UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974/3 "2017-04-14T10:08:40Z")

</div>

Yes we have tried this authentication method. We first got the following

```
Apr 14 11:43:29 xxxxxxx postfix/smtpd[17754]: lost connection after STARTTLS from discourse.xxxx[XX.XXX.XX.XX]
Apr 14 11:43:29 xxxxxxx postfix/smtpd[17754]: disconnect from discourse.xxxx[XX.XXX.XX.XX]
Apr 14 11:43:29 xxxxxxx postfix/smtpd[17756]: lost connection after STARTTLS from discourse.xxxx[XX.XXX.XX.XX]

```

So I have changed the value of **DISCOURSE\_SMTP\_ENABLE\_START\_TLS** to false in the discourse app.yml file and I rebuiled it. Then, we got the following in our postfix server logs:

```
Apr 14 12:02:30 xxxxxxx postfix/smtpd[17754]: connect from discourse.xxxx[XX.XXX.XX.XX]
Apr 14 12:02:30 xxxxxxx postfix/smtpd[17754]: warning: discourse.xxxx[XX.XXX.XX.XX]: SASL LOGIN authentication failed: Invalid authentication mechanism
Apr 14 12:02:30 xxxxxxx postfix/smtpd[17754]: lost connection after AUTH from discourse.xxxx[XX.XXX.XX.XX]
Apr 14 12:02:30 xxxxxxx postfix/smtpd[17754]: disconnect from discourse.xxxx[XX.XXX.XX.XX]

```

---

<div class="post-metadata">

### Author: ![vmassol](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vmassol/32/70740_2.png) [@vmassol](https://meta.discourse.org/u/vmassol)
#### Post date: [April 14, 2017, 10:30am UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974/4 "2017-04-14T10:30:04Z")

</div>

Thanks for your reply @zogstrip ! I’ve let Kevin reply since he’s the one who did the setup.

---

<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: [May 25, 2019, 10:30am UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974/5 "2019-05-25T10:30:08Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 26, 2019, 11:03pm UTC](https://meta.discourse.org/t/installing-discourse-with-digest-md5-mail-authentication/60974/6 "2019-05-26T23:03:33Z")

</div>


