Author Topic: Losing user data when changing username_domain  (Read 1975 times)

Offline cneilley

  • Newbie
  • *
  • Posts: 2
Losing user data when changing username_domain
« on: April 02, 2024, 09:17:15 AM »
I am having an issue with new user accounts having their primary identity be created as "username@mail.example.com" when previously they were being created as "username@example.com"

It does not matter so much for authentication to the mail server, as we just look to the username, but it is confusing end users.

I am aware that username_domain should be set to "example.com" to fix this, but when I do, all older accounts lose all of their preferences and data.

I checked the mysql database and see that if I change the mail_host to example.com instead of mail.example.com for the user, I am logged in as the user_id (no new user is created on login), but my settings are gone and my contacts and collected addresses are all missing.

Is there a field other than the user_id that ties this information to the account that I can manually change to get the current users working seamlessly with their data while also having new accounts be created the way I want them?

Thank you,
Cam

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: Losing user data when changing username_domain
« Reply #1 on: April 02, 2024, 03:56:29 PM »
To change the domain used for the user's default identity you want to change the `mail_domain` config option.

`username_domain` is used for login only and the mail_host field in the database is populated based on `imap_host`
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline cneilley

  • Newbie
  • *
  • Posts: 2
Re: Losing user data when changing username_domain
« Reply #2 on: April 04, 2024, 08:19:42 AM »
To change the domain used for the user's default identity you want to change the `mail_domain` config option.

`username_domain` is used for login only and the mail_host field in the database is populated based on `imap_host`

This was the answer, thank you.