# Could I update the SMTP setting through discourse.config

**URL:** https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892
**Category:** Self-hosting
**Created:** [2015年四月24日 06:17 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892 "2015-04-24T06:17:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![berniegao](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@berniegao](https://meta.discourse.org/u/berniegao)
#### Post date: [2015年四月24日 06:17 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/1 "2015-04-24T06:17:18Z")

</div>

Hi @sam I manually install discourse, how could I update the SMTP setting besides through the config/environment/development.rb. Does the discourse.config fit the need?

---

<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: [2015年四月24日 08:03 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/2 "2015-04-24T08:03:14Z")

</div>

You should be putting the mail settings in the `env` block of the `app.yml` which is parsed by the launcher script.

Is there any reason not to use Docker on this machine?

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [2015年四月24日 10:37 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/3 "2015-04-24T10:37:04Z")

</div>

Yes, setting these options in `/config/discourse.conf` would work, e.g.

```plaintext
smtp_address = 10.0.0.1
smtp_port = 25
# etc...

```

However, this really isn’ the supported way to install Discourse. 😉

(All of these settings can also be given as environment variables to Unicorn; simply capitalize the setting’s name and add a `DISCOURSE_` prefix.)

---

<div class="post-metadata">

### Author: ![berniegao](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@berniegao](https://meta.discourse.org/u/berniegao)
#### Post date: [2015年四月25日 10:26 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/4 "2015-04-25T10:26:52Z")

</div>

I am using docker which is nice tool for deployment. However in my case, I gonna quickly test some configurations variables within the docker without rebuild the container every time.

---

<div class="post-metadata">

### Author: ![berniegao](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@berniegao](https://meta.discourse.org/u/berniegao)
#### Post date: [2015年四月25日 10:29 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/5 "2015-04-25T10:29:48Z")

</div>

why isn’t updating the /config/discourse the supported approach? 😄

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [2015年四月25日 10:46 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/6 "2015-04-25T10:46:49Z")

</div>

Hm, with “not supported” I’m not saying that it won’t work, but that you may get ignored if you run into problems during the installation and ask for help. After all, anyone trying to help would be guessing at what you’ve changed and basically poking in the dark to determine what’s wrong. 😃

---

<div class="post-metadata">

### Author: ![Blaisorblade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blaisorblade/32/107357_2.png) [@Blaisorblade](https://meta.discourse.org/u/Blaisorblade)
#### Post date: [2016年一月12日 16:29 UTC](https://meta.discourse.org/t/could-i-update-the-smtp-setting-through-discourse-config/27892/7 "2016-01-12T16:29:25Z")

</div>

This seems to have stopped working, even though I’m changing `/var/www/discourse/config/discourse.conf` — it seems to be reset at container startup O\_O.

I can’t be sure though — some processes are hanging in kernel-space, in `aufs`-related code, so changes might be just getting lost because of aufs, instead of being reset by userspace. I’ll try again later.
