From 057903a303cd78263750d39ddd70a96ac66212c7 Mon Sep 17 00:00:00 2001 From: yodax Date: Sun, 21 Feb 2016 13:49:07 +0100 Subject: [PATCH] Allow files in /home/user-data/mail/mailboxes --- management/mailconfig.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/management/mailconfig.py b/management/mailconfig.py index d9ffdf65..d044c1ab 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -137,19 +137,20 @@ def get_mail_users_ex(env, with_archived=False, with_slow_info=False): if with_archived: root = os.path.join(env['STORAGE_ROOT'], 'mail/mailboxes') for domain in os.listdir(root): - for user in os.listdir(os.path.join(root, domain)): - email = user + "@" + domain - mbox = os.path.join(root, domain, user) - if email in active_accounts: continue - user = { - "email": email, - "privileges": "", - "status": "inactive", - "mailbox": mbox, - } - users.append(user) - if with_slow_info: - user["mailbox_size"] = utils.du(mbox) + if os.path.isdir(os.path.join(root, domain)): + for user in os.listdir(os.path.join(root, domain)): + email = user + "@" + domain + mbox = os.path.join(root, domain, user) + if email in active_accounts: continue + user = { + "email": email, + "privileges": "", + "status": "inactive", + "mailbox": mbox, + } + users.append(user) + if with_slow_info: + user["mailbox_size"] = utils.du(mbox) # Group by domain. domains = { }