mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
13.98k stars 1.44k forks source link

Permanent removal of user #1993

Open gmartinez opened 3 years ago

gmartinez commented 3 years ago

Hi there, I am new to MiaB, although after some searching I did not find anything related I am guessing this has been already discussed at some point so my apologies in advance on this regard.

I can see that removing a user either from the admin interface or via API only disable/archive/trash the user eventually allowing to restore it, which is perfect. Still I need a way to eventually permanently delete such user.

Maybe you can refer me to some further thread on the subject or provide some advice.

If you ask me, ideally, an extra parameter to the /mail/users/remove endpoint allowing to specify that the user is to be permanently delete would be great.

Thanks in advance. Gonzalo.

myfirstnameispaul commented 3 years ago

Or even just a documented command line method for deletion.

It appears even archived users are still in the /home/user-data/mail/users.sqlite database. I'm wondering if there may be a dovecot related command for deleting users completely, but I haven't gone looking.

This actually matters for migrating domains to different servers so the mails can be safely deleted and storage freed without causing some future script-halting glitch in MiaB.

Without further investigation, the only way I can think to free up the storage would be to delete all of the emails before archiving the account.

abbluiz commented 2 years ago

By the way, I am not being able to "archive" an user through the Administration dashboard. The page just freezes in a white screen.

I am trying to delete all the users from a specific domain, that I don't intend to use anymore.

EDIT: Trying to do that on v55

46cv8 commented 1 year ago

I'm running v60.1 and archive appeared to work for me for a user that I just created that didn't have any folder created yet at /home/user-data/mail/mailboxes/DOMAIN/username. It would be good to be a little more clear about how Archive is identical to making a call against "curl -X POST -d "email=new_user@mydomail.com" https://box.their.cloud/admin/mail/users/remove", After which it seems like the remaining step based on https://discourse.mailinabox.email/t/delete-user-how-to-delete-all-user-created/3193/2 is to run "sudo rm -rf /home/user-data/mail/mailboxes/mydomain/new_user". After which if there is really stuff left behind in /home/user-data/mail/users.sqlite I guess an additional clean-up script would be necessary.