# Unable to change email address after switching domains

**URL:** https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374
**Category:** Support
**Created:** [3 באפריל,‏ 2017,‏ 12:43pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374 "2017-04-03T12:43:12Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![john-lynch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john-lynch/32/81514_2.png) [@john-lynch](https://meta.discourse.org/u/john-lynch)
#### Post date: [3 באפריל,‏ 2017,‏ 12:43pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/1 "2017-04-03T12:43:12Z")

</div>

I’ve just started hosting a very small, private Discourse community. I’m a newbie; please be gentle.

When I originally set the community up, I set it up at [foo.com](http://foo.com). My members and I hadn’t determined what permanent domain we’d like, so I set one up temporarily. After we’d made that determination to switch to [bar.com](http://bar.com), I followed the instructions [here](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098) to change the domain. It worked almost perfectly.

There was one slight hitch: originally, my admin account was set in Discourse to use the email address [admin@foo.com](mailto:admin@foo.com). The hostname for the Discourse install was simply [foo.com](http://foo.com); I did not use a subdomain. When I changed domains, I decided to use [www.bar.com](http://www.bar.com) as the hostname; in other words, the original hostname did _not_ include the www subdomain, but the new one did. The problem is two-fold: first, the instructions above for switching domains caused the admin email account to be changed to [admin@www.bar.com](mailto:admin@www.bar.com) (I assume it was the remap/rebake step that did this; willing to be wrong about this); second, when I try to correct the email address (to [admin@bar.com](mailto:admin@bar.com)), Discourse keeps trying to email [admin@www.bar.com](mailto:admin@www.bar.com) (according to my sparkpost message logs), which doesn’t exist. I assume it’s supposed to email the _new_ email address so that I can confirm it exists. The result is that I have no way to get a correct email address for my admin account: the domain switch step changed it to something invalid, and the change email process keeps emailing an invalid address.

I’m new enough at this that I’m not sure if I’m reading the situation correctly. I’m happy to answer any questions. Thanks for you assistance and patience.

---

<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: [3 באפריל,‏ 2017,‏ 1:29pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/2 "2017-04-03T13:29:01Z")

</div>

Discourse will send mail with it’s domain name. You need to configure spark post to deliver for that domain. That’s the best and easiest solution.

You can also edit app.yml and uncomment a line best the bottom to set the sending address to the old domain.

If you’ve lost access to your Discourse admin account, you can enter the container and

rake admin: create

You can do a search for more complete instructions.

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [3 באפריל,‏ 2017,‏ 1:35pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/3 "2017-04-03T13:35:13Z")

</div>

@pfaffman I don’t think this is about the sending address, but about the admins receiving address.

> [@john-lynch](#):
>
> caused the admin email account to be changed to [admin@www.bar.com](mailto:admin@www.bar.com) (I assume it was the remap/rebake step that did this

Yes, always include `//` if you are remapping domains, so `//foo.com` to `//www.bar.com`  
Just remapping `foo.com` to `www.bar.com` does nasty things.

You can always remap the emails to correct them: remap `@www.bar.com` to `@foo.com`

---

<div class="post-metadata">

### Author: ![john-lynch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john-lynch/32/81514_2.png) [@john-lynch](https://meta.discourse.org/u/john-lynch)
#### Post date: [3 באפריל,‏ 2017,‏ 2:04pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/4 "2017-04-03T14:04:55Z")

</div>

> [@michaeld](#):
>
> I don’t think this is about the sending address, but about the admins receiving address.

That’s correct. Email is sending to everyone else just fine. Performing another remap seems like a viable option. But why would Discourse be trying to email the address that I’m trying to switch _from_ and not the one I’m trying to switch _to_? That’s the part I really don’t understand.

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [3 באפריל,‏ 2017,‏ 2:09pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/5 "2017-04-03T14:09:18Z")

</div>

> [@john-lynch](#):
>
> But why would Discourse be trying to email the address that I’m trying to switch from and not the one I’m trying to switch to?

It wants to confirm _both_.

`we need you to confirm that you control the current email account. After you complete this step, we will have you confirm the new email address.`

I guess it’s a security measure, but in our experience it causes more trouble than it does good.

---

<div class="post-metadata">

### Author: ![john-lynch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john-lynch/32/81514_2.png) [@john-lynch](https://meta.discourse.org/u/john-lynch)
#### Post date: [3 באפריל,‏ 2017,‏ 2:18pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/6 "2017-04-03T14:18:05Z")

</div>

Huh. I guess I missed that. My apologies. This does seem really problematic; I would have thought that access to my Discourse account was proof enough that I should be allowed to change the email address. I don’t think I’ve ever had a system email my old address before as a necessary confirmation step (but then I don’t change email addresses often, so what do I know). This is intended behavior then, not a bug. I’ll try the suggested remap and see if that works. Thanks!

---

<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: [3 באפריל,‏ 2017,‏ 3:28pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/7 "2017-04-03T15:28:23Z")

</div>

> [@michaeld](#):
>
> I guess it’s a security measure

> [@john-lynch](#):
>
> I would have thought that access to my Discourse account was proof enough that I should be allowed to change the email address

It is a security measure - and it only applies to Admin accounts. Among other things, email serves as a form of two-factor auth for admin tasks, like downloading backups. If your admin account was compromised and the email could be changed without your knowledge - they could simply change the email to get the backup. This feature prevents that.

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [3 באפריל,‏ 2017,‏ 3:54pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/8 "2017-04-03T15:54:33Z")

</div>

Makes perfect sense, thanks for explaining!

---

<div class="post-metadata">

### Author: ![john-lynch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john-lynch/32/81514_2.png) [@john-lynch](https://meta.discourse.org/u/john-lynch)
#### Post date: [4 באפריל,‏ 2017,‏ 4:04am UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/9 "2017-04-04T04:04:31Z")

</div>

> [@michaeld](#):
>
> You can always remap the emails to correct them: remap @www.bar.com to @foo.com

I tried this just now and it appears to have worked. Thank you everyone for your patient assistance.

As a side question: is there a standard solution for if an admin needs to change their email address from an email address they no longer have access to? Or are you just out of luck at that point?

---

<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: [4 באפריל,‏ 2017,‏ 4:27am UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/10 "2017-04-04T04:27:13Z")

</div>

> [@john-lynch](#):
>
> is there a standard solution for if an admin needs to change their email address from an email address they no longer have access to?

Your best bet is to work with another admin. Demote the account you need to change the email on. Change the email (no current email confirmation as you’re no longer admin). Promote the account back to admin.

---

<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: [21 במאי,‏ 2019,‏ 11:46pm UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/11 "2019-05-21T23:46:39Z")

</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: [23 במאי,‏ 2019,‏ 11:54am UTC](https://meta.discourse.org/t/unable-to-change-email-address-after-switching-domains/60374/12 "2019-05-23T11:54:29Z")

</div>


