mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix mailbox info when user not allowed to access to mail
This commit is contained in:
parent
5a6a85ab07
commit
9109850fb0
2 changed files with 3 additions and 0 deletions
|
@ -288,6 +288,7 @@
|
||||||
"mail_alias_remove_failed": "Unable to remove mail alias '{mail:s}'",
|
"mail_alias_remove_failed": "Unable to remove mail alias '{mail:s}'",
|
||||||
"mail_domain_unknown": "Unknown mail address domain '{domain:s}'",
|
"mail_domain_unknown": "Unknown mail address domain '{domain:s}'",
|
||||||
"mail_forward_remove_failed": "Unable to remove mail forward '{mail: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",
|
"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",
|
"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",
|
"maindomain_change_failed": "Unable to change the main domain",
|
||||||
|
|
|
@ -437,6 +437,8 @@ def user_info(auth, username):
|
||||||
|
|
||||||
if service_status("dovecot")["status"] != "running":
|
if service_status("dovecot")["status"] != "running":
|
||||||
logger.warning(m18n.n('mailbox_used_space_dovecot_down'))
|
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:
|
else:
|
||||||
cmd = 'doveadm -f flow quota get -u %s' % user['uid'][0]
|
cmd = 'doveadm -f flow quota get -u %s' % user['uid'][0]
|
||||||
cmd_result = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
|
cmd_result = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
|
||||||
|
|
Loading…
Add table
Reference in a new issue