Fixed mailbox removal.

see #1046
This commit is contained in:
Antoine Nguyen
2017-02-27 16:17:08 +01:00
parent 7e6f02a536
commit 55bdf3a82f
3 changed files with 12 additions and 9 deletions
+1 -2
View File
@@ -226,8 +226,7 @@ class Domain(AdminObject):
if self.alias_set.count():
ungrant_access_to_objects(self.alias_set.all())
if param_tools.get_global_parameter("auto_account_removal"):
for account in User.objects.filter(mailbox__domain=self):
account.delete(fromuser, keepdir)
User.objects.filter(mailbox__domain=self).delete()
elif self.mailbox_set.count():
Quota.objects.filter(username__contains="@%s" % self.name).delete()
ungrant_access_to_objects(self.mailbox_set.all())