Roundcube Community Forum

 

delete user in the roundcube table after delete from postfixadmin

Started by dimago, August 11, 2011, 06:02:09 PM

Previous topic - Next topic

dimago

Hello All,

I was thinking about to delete the user database after delete user from postfixadmin.

So, I create users by postfixadmin. Its works fine. The user is inserted in the mail database. When I logging in the webmail, the user and others informations is inserted in the webmail database, right?

So, when I remove a user from postfixadmin, its removed from mail database, but in the webmail database doesn´t. I understand that, but I would like that the user will be deleted from the webmail database too.

Can anyone knows how can I do this?

Thanks,

Diego

JohnDoh

one way would be to run a cron job every night and delete anything in the rc users table which doesnt exist in the postfix one. as long as the rc tables are linked properly the delete will cascade and delete all the user's stuff from the other tables automatically.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

dimago

Hi John,

Thanks again for you help.

So, let me see if I understood.

OK, I know what users I want to delete.

I make a script to delete the user diego in the USERS RC tables, like this: delete from USERS where USERNAME='diego'; ?

So, the rest of info about the user, in anothers RC tables will be deleted automatically?

Thanks,

Diego

JohnDoh

thats the idea, though I think it might depend on your particular implementation. take a look at the rc sql file mysql.initial.sql in trunk/roundcubemail/SQL see all the "ON DELETE CASCADE" bits? thats what does it.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

oldschool


dimago

hey John,

Here my feedback.

It´s works.

I did:

delete from users where username='[email protected]';

and all of infos in the tables are deleted.

I will make a script to do this auto to me.

Thanks again.

Diego