- def delete_account(account)
- # Will raise an exception if the path doesn't exist.
- account_path = self.get_account_path(account)
- FileUtils.rm_r(account_path)
+
+ # Remove *user* from the Dovecot mailstore. This just runs "rm -r"
+ # on the *user*'s mailbox directory, if it exists.
+ #
+ # @param user [User] the user whose mailbox directory we want to
+ # remove.
+ #
+ def remove_user(user)
+ user_path = self.get_user_path(user)
+
+ if not File.directory?(user_path)
+ raise NonexistentUserError.new(user.to_s())
+ end
+
+ FileUtils.rm_r(user_path)