mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
do not use email_validator in get_email_domain_part()
This commit is contained in:
parent
3ad961bfb9
commit
8301015afd
|
@ -128,7 +128,6 @@ def try_auto_create_via_domain(address: str) -> Optional[Alias]:
|
|||
# check if alias is custom-domain alias and if the custom-domain has catch-all enabled
|
||||
alias_domain = get_email_domain_part(address)
|
||||
custom_domain: CustomDomain = CustomDomain.get_by(domain=alias_domain)
|
||||
alias_note = ""
|
||||
|
||||
if not custom_domain:
|
||||
return None
|
||||
|
|
|
@ -404,10 +404,8 @@ def get_email_domain_part(address):
|
|||
Get the domain part from email
|
||||
ab@cd.com -> cd.com
|
||||
"""
|
||||
r: ValidatedEmail = validate_email(
|
||||
address, check_deliverability=False, allow_smtputf8=False
|
||||
)
|
||||
return r.domain
|
||||
address = sanitize_email(address)
|
||||
return address[address.find("@") + 1 :]
|
||||
|
||||
|
||||
# headers used to DKIM sign in order of preference
|
||||
|
@ -532,7 +530,9 @@ def email_can_be_used_as_mailbox(email_address: str) -> bool:
|
|||
- a disposable domain
|
||||
"""
|
||||
try:
|
||||
domain = get_email_domain_part(email_address)
|
||||
domain = validate_email(
|
||||
email_address, check_deliverability=False, allow_smtputf8=False
|
||||
).domain
|
||||
except EmailNotValidError:
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue