froxlor / Froxlor

The server administration software for your needs - The official Froxlor development Git repository
http://www.froxlor.org
GNU General Public License v2.0
1.62k stars 455 forks source link

Domains.delete doesn't delete mail data #1239

Closed Smith4545 closed 3 months ago

Smith4545 commented 6 months ago

Describe the bug When removing a domain either through the web UI or via the API (Domains.delete), the corresponding email accounts are deleted from the database, but the Maildirs themselves are not removed.

System information

To Reproduce Steps to reproduce the behavior:

  1. Create a domain either via API or the web UI's admin interface.
  2. Create a mail address on that domain.
  3. Convert the mail address to a mail account. (let it send you a welcome mail)
  4. Delete the domain via API or the web UI's admin interface.
  5. The Maildir still exists on filesystem.

Expected behavior

Additionally to deleting the respective rows from mail_users here:

https://github.com/Froxlor/Froxlor/blob/fb5958f5d415a41c84613c43b4e26ba986a29774/lib/Froxlor/Api/Commands/Domains.php#L2138

The corresponding directory for the domain should be rm -rf'ed at the customers vmail basedir.

Additional context

Since Froxlor allows users to "keep" mail data in other situations independently from deleting accounts in mail_users, it may be beneficial to implement a similar functionality in this case as well.

d00p commented 6 months ago

As of now, yes, this is intended behaviour in order to not accidentally loose customer data. I agree, a switch/parameter to specifically give option to remove files from the filesystem should be added