end
- def get_user_path(user)
- # Return the filesystem path of this user's mailbox.
- # Only works if the user exists!
+ def get_user_path(user, existence_check = true)
+ # Return the filesystem path of this user's mailbox. With
+ # existence_check = true, it only works if the user exists!
+ # We always require that the domain exists.
if not user.include?('@')
msg = "#{user}: Users must contain an '@' symbol."
raise InvalidUserError.new(msg)
user_path = File.join(domain_path, local_part)
+ return user_path if not existence_check
+
if File.directory?(user_path)
return user_path
else