mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 21:08:03 +00:00
simplify get_user_maildir
This commit is contained in:
@@ -39,10 +39,8 @@ class Config:
|
|||||||
return open(self._inipath, "rb")
|
return open(self._inipath, "rb")
|
||||||
|
|
||||||
def get_user_maildir(self, addr):
|
def get_user_maildir(self, addr):
|
||||||
if addr and addr != "." and "/" not in addr:
|
if addr and addr != "." and addr != ".." and "/" not in addr:
|
||||||
res = self.mailboxes_dir.joinpath(addr).resolve()
|
return self.mailboxes_dir.joinpath(addr)
|
||||||
if res.is_relative_to(self.mailboxes_dir):
|
|
||||||
return res
|
|
||||||
raise ValueError(f"invalid address {addr!r}")
|
raise ValueError(f"invalid address {addr!r}")
|
||||||
|
|
||||||
def get_user_dict(self, addr, enc_password):
|
def get_user_dict(self, addr, enc_password):
|
||||||
|
|||||||
Reference in New Issue
Block a user