1

Topic: SOGo user profiles not automatically deleted

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? NO
====

Hi,
I noticed that if a user is deleted via the web interface it is actually deleted in SOGo as well (table "users"), but the profile stays there (table "sogo_user_profile") and it has to be removed manually with the sogo-tool (sogo-tool remove <user>).
I don't know if it is a known issue (I can't find nothing related in the forum).
I'm trying to build a shell script to delete the profile at the same time of the mailbox directory (no python skills), but perhaps the best way is to perform this deletion when the user is deleted via the web interface or in the python code that deletes the mailbox directory.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: SOGo user profiles not automatically deleted

SteelBlade wrote:

I don't know if it is a known issue (I can't find nothing related in the forum).

Yes, known issue.

We will try to fix this.

3

Re: SOGo user profiles not automatically deleted

Eventually I figured out how to call an external command in python and added some lines to delete_mailboxes.py just after the "Delete Mailbox" section in order to delete the SOGo user profile along with the mailbox:

            # Delete SOGo user profile
            from subprocess import call
            call(['/sbin/sogo-tool', 'remove', username])

for sure it's kind of brutal, but it works for me.

4

Re: SOGo user profiles not automatically deleted

There's a concern to remove SOGo data:

- For mailbox, each time you create a user, it has a unique maildir path (because there's a timestamp in maildir path), so it's safe to remove old mailbox (stored in SQL db "vmail.deleted_mailboxes").
- For SOGo data, it's done with an email address (sogo-tool remove <email>), if same email address was re-created after first removal, you may delete this new user's SOGo data.

5

Re: SOGo user profiles not automatically deleted

Hello.

iRedMail team, have you fixed this problem? Is any official workaround?

I'm running iRedMail 1.3.2 with SOGo 5.1.

Thank you.

6

Re: SOGo user profiles not automatically deleted

No. What's your expected workaround? Deleting data from SOGo database while removing user?

7

Re: SOGo user profiles not automatically deleted

Yes. Deleting user data from tables sogo_user_profile and sogo_folder_info when user is removed.
This implementation could be in /opt/www/iredadmin/tools/delete_mailboxes.py script?

8

Re: SOGo user profiles not automatically deleted

roccoro wrote:

This implementation could be in /opt/www/iredadmin/tools/delete_mailboxes.py script?

Yes it could be in delete_mailboxes.py.

I will put it on my TODO list. Thanks for the feedback. smile