diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 79cc7cdaa..08478e2b4 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -148,6 +148,7 @@ user: extra: pattern: *pattern_username --purge: + help: Purge user's home and mail directories action: store_true ### user_update() diff --git a/src/yunohost/user.py b/src/yunohost/user.py index ebed6dbd2..a38f0b4c5 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -251,6 +251,7 @@ def user_delete(operation_logger, auth, username, purge=False): if auth.update('cn=sftpusers,ou=groups', {'memberUid': memberlist}): if purge: subprocess.call(['rm', '-rf', '/home/{0}'.format(username)]) + subprocess.call(['rm', '-rf', '/var/mail/{0}'.format(username)]) else: raise YunohostError('user_deletion_failed')