RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Release Support > Release Discussion

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 07-06-2009, 08:57 PM
Registered User
 
Join Date: May 2009
Location: Orlando, FL
Posts: 41
Send a message via AIM to Carlwill
Question MySQL - What Tables Are Modified For New Users?

I am running MySQL 5 and Roundcube and would like to know when a user logs into Roundcube for the 1st time, what table entries are modified / touched / created in the database?

I have Roundcube configured to create the user data in the database when you login for the 1st time however I don't know what is created for a new user. This helps me know what needs to be deleted when that user is gone. If I delete that user from my Linux system, I don't want their Roundcube MySQL database data to clutter up after they're deleted from the system.

Can someone please help me?

Last edited by Carlwill; 07-07-2009 at 04:12 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-07-2009, 08:23 AM
Super Moderator
 
Join Date: May 2007
Posts: 616
Default

There will be an entry in the Users table and the Identities table, then once they start using the system they could have multiple entries in the Identities table, the Contacts table and if you have caching enabled then in the cache and messages tables too.
__________________
RoundCube Patches & Plugins: Managesieve, SpamAssassin Prefs, and more…
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 07-07-2009, 03:03 PM
Registered User
 
Join Date: May 2009
Location: Orlando, FL
Posts: 41
Send a message via AIM to Carlwill
Default

Thanks. Is there an simple solution I can use or how do other RC admins manage when someone leaves and their Linux shell account is removed. I don't want their accounts to linger with useless data in MySQL. Is there a simple solution to cleaning up MySQL once I remove a user from my mail server?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 07-07-2009, 09:26 PM
Registered User
 
Join Date: Apr 2009
Posts: 1
Default

Hi there!

I have made a couple of bash-scripts to solve this nicely on my domain. Note that you need to know the RC user id of the user you need to remove (I usually map the RC user id to the linux uid when I create a RC user for convenience).

Run the following 5 SQL commands on your RC DB to remove a user:
DELETE FROM messages WHERE messages.user_id = <USERID>;
DELETE FROM cache WHERE cache.user_id = <USERID>;
DELETE FROM contacts WHERE contacts.user_id = <USERID>;
DELETE FROM identities WHERE identities.user_id = <USERID>;
DELETE FROM users WHERE users.user_id = <USERID> LIMIT 1;

If the RC user id of your user is 6 then replace <USERID> above with 6.

Please also note that users table must be the last one where you remove the user.

Hope this helps a bit.

~# Magnus

Last edited by maka; 07-07-2009 at 09:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 01:26 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright © 2006-2008 RoundCube Webmail Community