I entered the wrong admin email address during initial setup

I have a couple of test sites running Discourse just with IP’s at present and I have been testing Elastic Email (EE).

Seems ok so far but I haven’t done the domain verification SPF stuff yet.

I want to change the admin email address but it’s an email address that is being “suppressed”, not bounced by EE. So I am not receiving the verification notices to change the email address (or set up new admins etc).

I have manually created another admin where the email address is getting through EE and tried to change the email address of the “broken” admin via their preferences (rather than admin section). It allows me to change the address but it’s sending out a request to the suppressed email account for verification of the change.

How do I complete the verification?

Is there a process in rails or a hack of the database I can do? I don’t want to kill the admin as they have posts on the site that it will affect.

1 Like

Any thoughts on how to validate an incorrect email address?

As main admin I’m still unable to validate the incorrect email address I used when I created the Discourse site.

What is the hack to validate the email so I can then go on and enter the correct email address?

You are probably out of luck if you screw up the admin email… Probably the one thing in discourse that you can’t screw up, as the admin controls everything and your only way to recover an admin password is thru its email…

EDIT: Maybe a ninja here can teach you how to modify the database record directly… The email is stored in a simple table.

2 Likes

@schungx yes I guess I’m looking for a Discourse db Ninja. Maybe Google can help me find the Ninja.

Google brings up this thread How to access the discourse database?
Bit short on details but I will work through it until a real Ninja comes along.

I am sure you can simply go into rails console and execute a rails command to change it, just like changing all other types of user settings that you can search here on meta.

Email is a bit tricky as it is moved out into a separate table a while ago so some of the old tricks won’t work.

I did wonder about the ongoing changes to Discourse.

I have no rails experience at all.

Does anyone know the command line fix?

Or, try to go into rails console and send yourself an invitation with the admin group.

Or register a normal user, then use the rails console to make that user an admin.

1 Like

I have done this so I have a second fully operational admin account but really I need the original one to work as that one created all the categories and topics etc.

I know there is the facility to switch posts from one user to another and I could become admin2 but that seems quite tedious.

Even if I knew how to do this the invite will not get through the spam filters. The email address I entered is actually valid but maybe because Discourse is trying to send validation from thisDomain.com to me@thisDomain.com then Elastic Email are blocking it.

What’s wrong with impersonating the other admin account? Just press impersonate.

1 Like

Or if you just want to change the email, you can deactivate that account, change the email, and activate it again. Not sure if this still works but you can try…

But if you already have an admin account you can do anything. You don’t really need to use the original account. There isn’t anything you can’t do…

1 Like

Just run discourse-setup again.

You can also create an admin with

rake admin:create

inside the container

4 Likes

I have done this to set up admin2 but it’s admin1 that I want to fix.

A question regarding discourse-setup. I have been through the process many times over the last few days and at the moment the details are set to admin2. If I set them to admin1 will it change the allocated email address without the system asking for admin1 to confirm the change from the “blocked” email address? That is what it does in the main Discourse admin panel and it will not fix my problem.

You can change default admin email address in app.yml file as below

2 Likes

Not recommended, if all you need to do is change the email address, follow @pfaffman’s advice and run discourse-setup again instead.

4 Likes

Thanks @pfaffman and Jeff I’ll give it a bash.

take admin:create will let you set a password so you can log in without email working. I think this solves your problem (but your problem is really that email doesn’t work)).

You can put multiple admin addresses in app.yml (with discourse-setup)) by separating them with commas.

2 Likes

Via discourse-setup right?

But what is the syntax for entering passwords relating to multiple admin accounts if I tried your suggestion?

I know it’s wrong, but I have one long complex password that I use for 100’s of logins around the world but I would still need to know the correct syntax. Comma separated like the email addresses, just one password for all admins or some other combination in discourse-setup ?

There are no user passwords in app.yml, so ./discourse-setup does not set admin passwords. rake admin:create does; you can run it and add as many users as you want.

It’s completely unrelated to the discussion here, but “Wrong” does not begin to describe what that is. You really need a password manager. Let your browser remember them or get a password manager. Here is a good review: https://thewirecutter.com/reviews/best-password-managers/. I like keepassx because only I have access to my password file (well, and Dropbox, but I’m pretty sure they don’t have the password for it).

5 Likes