Author Topic: Contacts are not shown, but are in database  (Read 1412 times)

Offline Taleman

  • Newbie
  • *
  • Posts: 5
Contacts are not shown, but are in database
« on: January 01, 2017, 04:06:44 AM »
Roundcube Version 0.7.2-9+deb7u5
Debian GNU/Linux 7.11 (wheezy)

I have checked the contacts and contact groups are in mysql database. They seem OK, I checked with queries the records can be accessed and if my quess about the working of the database are correct the data is there as it should be.

The contacts became inaccessible after upgrade. Maybe the database is broken? After release upgrade the contact info disappeared from the database. I dumped the pre-upgrade database and imported it, then ran the database upgrades scripts Debian provided. This got the contacts and contact groups back in the database, but when looking at them in Roundcube the contact groups are empty.

How to get contact info back in usable state?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1,964
Re: Contacts are not shown, but are in database
« Reply #1 on: January 01, 2017, 10:47:01 AM »
Have a look in the users table in the Roundcube database and see if there are multiple entries for your userid with different values in the mail_host column. if so then delete the new user and update the value for your original user with your new mail_host value.

0.7.2 is nearly 5 years old. You should consider ditching the Debian package and install Roundcube direct from source.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Taleman

  • Newbie
  • *
  • Posts: 5
Re: Contacts are not shown, but are in database
« Reply #2 on: January 01, 2017, 01:31:13 PM »
There are users with almost same name, but user ID's are distinct. Some users have localhost as mail_host, some have FQDN. I do not know why, but both seem to work. The almost same usernames differ in the first character, it is Uppercase or lowercase. Again I do not know wherefore they are so.

As far as I know, contact lists are empty for all users, not just me.



Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1,964
Re: Contacts are not shown, but are in database
« Reply #3 on: January 02, 2017, 04:00:27 AM »
if you compare the user id's from the users table with the ones in the contacts table then you will be able to see which ones are correct.

for the uppercase lowercase issue there is a config option in Roundcube called `login_lc` which will convert the username that the user enters to always be lowercase. for the mail_host, that has to match what ever the value of default_host is.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Taleman

  • Newbie
  • *
  • Posts: 5
Re: Contacts are not shown, but are in database
« Reply #4 on: January 02, 2017, 01:20:13 PM »
Currently login_lc has value false. But the docs at
https://github.com/roundcube/roundcubemail/wiki/Configuration
state the possible values are 0, 1 and 2.

Code: [Select]
main.inc.php:$rcmail_config['login_lc'] = false;
Is that false a remnant from older versions? Seems I need to put 2 there, the duplicate names are
jarkko@somedomain and Jarkko@somedomain, so the user name part needs to be lowercased.

The default_host is localhost. Seems it was previously tls://<fqdn>, but I think it should be localhost when the
mail server and roundcube are on the same host.

It seems some gremlin has created extra users to roundcube database. Like, for user x that has logged in there are both
mail_host localhost and the fqdm, and for both those x@ and X@ usernames.

I think I now understand what is going on, and can go and fix the mess. Thank you for your help.

Offline Taleman

  • Newbie
  • *
  • Posts: 5
Re: Contacts are not shown, but are in database
« Reply #5 on: January 02, 2017, 02:06:52 PM »
Seems I was overly optimistic.

I checked from contactgroupmembers that contact group 7 has 98 members. I changed in table contactgroups the user_id for contactgroup 7 to my user_id. Now I can see that group in my Roundcube addressbook, but there are no entries shown.

If I create a new contact group and add contact card to it, those are shown.

Maybe I do not understand how the database works? I thought I could fix this by poking around in the db.

Online SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,261
    • http://SKaero.com/
Re: Contacts are not shown, but are in database
« Reply #6 on: January 02, 2017, 02:20:29 PM »
You would also need to change the user_id in the contacts table.