# SMTP User name does not save

**URL:** https://meta.discourse.org/t/smtp-user-name-does-not-save/73398
**Category:** Bug
**Created:** [November 4, 2017, 3:55am UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398 "2017-11-04T03:55:42Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![kgreed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kgreed/32/168602_2.png) [@kgreed](https://meta.discourse.org/u/kgreed)
#### Post date: [November 4, 2017, 3:55am UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/1 "2017-11-04T03:55:42Z")

</div>

When I re run

> ./discourse-setup

the SMTP email becomes [postmaster@discourse.mydomain.com](mailto:postmaster@discourse.mydomain.com)  
even though I previously entered [myuser@mydomain.com](mailto:myuser@mydomain.com)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 4, 2017, 5:06am UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/2 "2017-11-04T05:06:57Z")

</div>

Can you reproduce this @pfaffman?

---

<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: [November 6, 2017, 4:34pm UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/3 "2017-11-06T16:34:52Z")

</div>

Oh! @kgreed is correct! Apparently the “user the default mailgun username” code overrides the “use the pre-existing settings” code. I’m guessing that few people change their mailgun username, so this is an edge case.

Now that I think about it, the code that loads the defaults happens before the “oh! It’s mailgun, I know what to do” code. I’ll have a look and see if this is easy to fix.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 5, 2018, 1:58am UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/4 "2018-04-05T01:58:41Z")

</div>

Did this get fixed? Anything else to do here?

---

<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: [April 5, 2018, 2:17am UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/5 "2018-04-05T02:17:05Z")

</div>

It’s on my list,which has quite a few things on it now. I think that this one affects few people. It’s annoying, because you have to re-enter the value rather than have your old value used. It’s not quite a bug, because it does work.

I’ll try to submit a PR this week.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [April 5, 2018, 8:26pm UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/6 "2018-04-05T20:26:16Z")

</div>

Same or related:

> [@Minor glitch in discourse-setup](https://meta.discourse.org/t/minor-glitch-in-discourse-setup/77133?u=tophee):
>
> I noticed that when you run ./discourse-setup again after an initial run, it seems to remember the values entered during the previous run (i.e. email addresses, smtp password etc). But it does not remember the SMTP user name, worse even, it remembers it wrongly. It neither suggests the value that is actually in the app.yml nor does it resort to the default value (postmaster@discourse.example.com). Instead it seems to construct the suggested address by combining postmaster@ with the forum’s doma…

---

<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: [April 5, 2018, 11:27pm UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/7 "2018-04-05T23:27:51Z")

</div>

Here, ya go.

[https://github.com/discourse/discourse\_docker/pull/391](https://github.com/discourse/discourse_docker/pull/391)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 6, 2018, 3:32am UTC](https://meta.discourse.org/t/smtp-user-name-does-not-save/73398/8 "2018-04-06T03:32:37Z")

</div>


