Fixed Docker image entrypoint.sh email validation. #8410

Introduces a GLOBALLY_DELIVERABLE variable so that it can be passed to the email validator library
and ultimately allowing the email admin@localhost to be valid, as long as False is passed in.

Also:
* Adjusted the indentation of a command above it in the entrypoint.sh
* Added printing out the output of the validation library so that we can better find what the actual issue is
This commit is contained in:
Igor Serko
2025-02-07 07:04:23 +00:00
committed by GitHub
parent 0b46bdf901
commit ae76ea3585
2 changed files with 12 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ def validate_email(email, email_config=None):
config.CHECK_EMAIL_DELIVERABILITY
email_config['ALLOW_SPECIAL_EMAIL_DOMAINS'] = \
config.ALLOW_SPECIAL_EMAIL_DOMAINS
email_config["GLOBALLY_DELIVERABLE"] = \
config.GLOBALLY_DELIVERABLE
# Allow special email domains
if isinstance(email_config['ALLOW_SPECIAL_EMAIL_DOMAINS'], str):
@@ -35,6 +37,9 @@ def validate_email(email, email_config=None):
except Exception:
pass
email_validator.GLOBALLY_DELIVERABLE = \
email_config["GLOBALLY_DELIVERABLE"]
# Validate.
_ = email_validate(
email,