# Hiding or encrypting SMTP password required in app.yml

**URL:** https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505
**Category:** Self-hosting
**Created:** [24.Апрель.2017 16:29:12 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505 "2017-04-24T16:29:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![tmelano](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@tmelano](https://meta.discourse.org/u/tmelano)
#### Post date: [24.Апрель.2017 16:29:12 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/1 "2017-04-24T16:29:12Z")

</div>

My group at work is testing discourse. There have been concerns raised about the requirement in the yml file for a typed password to access an smtp server. How secure is this? Is there an alternative in which the stmp password is stored in an encrypted way?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [24.Апрель.2017 16:42:37 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/2 "2017-04-24T16:42:37Z")

</div>

You can make your SMTP server allow connections without password, and check for a IP white list, for example.

---

<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: [24.Апрель.2017 16:49:50 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/3 "2017-04-24T16:49:50Z")

</div>

It’s available only to people with root access to the server. If you don’t trust people who have root access to your server, then you have more profound problems than worrying about whether they have access to an SMTP password.

---

<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: [24.Апрель.2017 19:38:46 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/4 "2017-04-24T19:38:46Z")

</div>

Also, this cannot be fixed: Discourse _needs_ the password to provide it to the SMTP server – so no matter how you store it, there _must_ be a way to read it. (This is similar to how web servers need the private key to their SSL certificate.)

---

<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: [26.Апрель.2017 17:52:16 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/5 "2017-04-26T17:52:16Z")

</div>

> [@tmelano](#):
>
> Is there an alternative in which the stmp password is stored in an encrypted way?

🤔 if it is encrypted, how would Discourse decrypt it?

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [26.Апрель.2017 21:43:20 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/6 "2017-04-26T21:43:20Z")

</div>

I’ve seen this solved. But the solution is ugly (in the sense that I wouldn’t recommend it for a [standard install](https://meta.discourse.org/t/142537?silent=true)).

The trick: encryption key in a shared memory location, supplied at boot time by a human.

This was the recommended way to use a credit card number storage tool I worked with a few years ago.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26.Апрель.2017 21:45:28 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/7 "2017-04-26T21:45:28Z")

</div>

> [@elijah](#):
>
> encryption key in a shared memory location

But if it’s in memory, surely a root user could still get access to it. (Granted it’s significantly more effort, but still)

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [26.Апрель.2017 21:47:30 UTC](https://meta.discourse.org/t/hiding-or-encrypting-smtp-password-required-in-app-yml/61505/8 "2017-04-26T21:47:30Z")

</div>

Yes. It’s not 100% secure, but it is also not something you could find with access to the backups.
