Topic: MYSQL Remove mailbox from file system upon delete.
==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
================ Required information ====
- iRedMail version: .0.8.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: centos 6.4
- Related log if you're reporting an issue:
====
We are close to pushing live our ired servers hosting +30,000.
Its looks to be a well known fact that iRedmail purposely does not delete a users actual mailbox from the harddrive, but only within the mysql DB.
I've read the reason and understand the reason for this, however, we're going to need to have those mailboxes deleted once you delete the user from the iredadmin panel. The iRed servers will be backed up, so that in the event an admin user accidentally deletes an account, the associated mailbox can be restored as needed.
The obvious concern is that we cannot litter the disk space with unused mailboxes and just leave files left on the harddrive. Postmasters will be able to create and remove mailboxes on their own, from a business standpoint, we cannot have regular(less experienced) staff members dropping down to shell deleting mailboxes manually, nor can we devote to much time to babying the tidiness of the file system. It's best that once that "Delete" user button has been pressed(by our staff member or a domain admin), that the physical mailbox on the hdd goes with it and/or have a logging mechanism that emails to out ticketing systems that x y and z users have been removed from the database, make sure to remove their actual email mailboxes.
Remember this is 30,000 accounts with 4389 domain and corresponding domain admins which can obviously add and delete users at their will, managing the file system properly is critical.
It looks like I should be able to sneak in a mysql query that first locates the mailbox dir and deletes it, then proceeds with the rest of its work... in "/libs/mysql/user.py"
We'll need something very similar to the LDAP solution found here
iredmail.org/forum/topic2853-iredadminpro-support-remove-mailboxes-when-deleting-user.html
I will say that I lack python experience, however I can write it, more over I can read and understand it.
Assistance will be of great help, as this is a major issue with this amount of users.
Thanks
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.