1

Topic: Howto delete user data of large amount of users?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: Ubuntu 14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hello.

I wondered if there is a way to automatically (via skript?) delete the data of users which are no longer in the LDAP. For our school this would be important because each year around 100 students are leaving our school and their email accounts and user data should be deleted.

Thanks in advance!

----

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

2

Re: Howto delete user data of large amount of users?

When you delete mail user, iRedAdmin will log the maildir path of this user's mailbox in SQL table 'iredadmin.deleted_mailboxes', you can write a shell/python script to delete them.

3

Re: Howto delete user data of large amount of users?

So I have to delete the user via iRedAdmin? (Deletion via bash or phpLDAPadmin is not possible?)

Could you give me some more advice how to delete these mailboxes?

4

Re: Howto delete user data of large amount of users?

Maildir path is stored in attribute 'homeDirectory' of user object, no matter how you delete it, you should get the maildir path before deleting this user. Then you can remove the maildir path with, e.g. command 'rm -rf'.