mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 07:13:18 +08:00
fix the E501 check (#1702)
This commit is contained in:
parent
bec8cb2292
commit
59c189957f
1 changed files with 7 additions and 6 deletions
|
@ -1020,12 +1020,13 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
|
||||||
reply_email = rcpt_to
|
reply_email = rcpt_to
|
||||||
|
|
||||||
reply_domain = get_email_domain_part(reply_email)
|
reply_domain = get_email_domain_part(reply_email)
|
||||||
# reply_email must end with EMAIL_DOMAIN
|
|
||||||
if not reply_email.endswith(EMAIL_DOMAIN) or not SLDomain.get_by(
|
# reply_email must end with EMAIL_DOMAIN or a domain that can be used as reverse alias domain
|
||||||
domain=reply_domain
|
if not reply_email.endswith(EMAIL_DOMAIN):
|
||||||
):
|
sl_domain: SLDomain = SLDomain.get_by(domain=reply_domain)
|
||||||
LOG.w(f"Reply email {reply_email} has wrong domain")
|
if sl_domain is None or not sl_domain.use_as_reverse_alias:
|
||||||
return False, status.E501
|
LOG.w(f"Reply email {reply_email} has wrong domain")
|
||||||
|
return False, status.E501
|
||||||
|
|
||||||
# handle case where reply email is generated with non-allowed char
|
# handle case where reply email is generated with non-allowed char
|
||||||
reply_email = normalize_reply_email(reply_email)
|
reply_email = normalize_reply_email(reply_email)
|
||||||
|
|
Loading…
Reference in a new issue