diff --git a/locales/en.json b/locales/en.json index 45c1fbb90..6ab780feb 100644 --- a/locales/en.json +++ b/locales/en.json @@ -288,6 +288,7 @@ "mail_alias_remove_failed": "Unable to remove mail alias '{mail:s}'", "mail_domain_unknown": "Unknown mail address domain '{domain:s}'", "mail_forward_remove_failed": "Unable to remove mail forward '{mail:s}'", + "mailbox_disabled": "Mailbox disabled for user {user:s}", "mailbox_used_space_dovecot_down": "Dovecot mailbox service need to be up, if you want to get mailbox used space", "mail_unavailable": "This email address is reserved and shall be automatically allocated to the very first user", "maindomain_change_failed": "Unable to change the main domain", diff --git a/src/yunohost/user.py b/src/yunohost/user.py index b800c9b0e..5e58909f7 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -437,6 +437,8 @@ def user_info(auth, username): if service_status("dovecot")["status"] != "running": logger.warning(m18n.n('mailbox_used_space_dovecot_down')) + elif not user_permission_list(auth, app="mail", permission="main", username=username)['permissions']: + logger.warning(m18n.n('mailbox_disabled', user=username)) else: cmd = 'doveadm -f flow quota get -u %s' % user['uid'][0] cmd_result = subprocess.check_output(cmd, stderr=subprocess.STDOUT,