pgadmin4
pgadmin4 copied to clipboard
Email Validation in pkg/docker/entrypoint.sh is too limited
Please note that security bugs or issues should be reported to [email protected].
Describe the bug
The Email-Validation for the docker image assumes a very basic level of emails. This limits out a large amount of possible emails. I.e. admin@localhost, [email protected], etc.
To Reproduce
Steps to reproduce the behavior:
- Create a docker compose
- Set PGADMIN_DEFAULT_EMAIL to admin@localhost
- See the error
Expected behavior
Any email by RFC standards should be accepted
Error message
'admin@localhost' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again.
Screenshots
Desktop (please complete the following information):
- OS: linux mint 21
- Version: dpage/pgadmin4:latest
- Mode: any
- Browser (if running in server mode): any
- Package type: container
Additional context
Add any other context about the problem here.
Hi @spthiel, please set PGADMIN_CONFIG_CHECK_EMAIL_DELIVERABILITY to False
in the environment variable while creating the docker container and try.
Hi @khushboovashi that does not change anything. Even if it did it is likely to be desired to check email deliverability with non standard (but rfc compliant) email formats
Hi @spthiel, This duplicates #6222, and check my comment here - https://github.com/pgadmin-org/pgadmin4/issues/6222#issuecomment-1530899862. Email deliverability check is disabled by default.
Hi @adityatoshniwal sorry for the delay in response.
I do not believe this duplicates #6222 as that issue deals with user accounts whereas this deals with the administrator email for the docker image. The workaround you supplied is also not possible to use here. As such I do not believe this ticket should be marked as done until at least a workaround for this exists
Hi @adityatoshniwal sorry for the delay in response.
I do not believe this duplicates #6222 as that issue deals with user accounts whereas this deals with the administrator email for the docker image. The workaround you supplied is also not possible to use here. As such I do not believe this ticket should be marked as done until at least a workaround for this exists
Administrator account is no different from other user accounts.
Administrator account is no different from other user accounts.
It is different as the email address for the administrator is evaluated at https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/docker/entrypoint.sh#L46
Administrator account is no different from other user accounts.
It is different as the email address for the administrator is evaluated at https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/docker/entrypoint.sh#L46
Yes that eventually is passed on to create a user account where all the validations will be done.
We are stuck in a loop here. To reiterate:
- I want to use admin@localhost as the default admin for my docker container
- I can allow this email via the link you posted to #6222
- I still cannot use admin@localhost as the admin email because the entrypoint denies me to specify this as email and exists the creation of the docker container
OK now I see what you're trying to say. I will re-open the issue for now. Even if we allow in entrypoint.sh, it might fail in email-validator package we use for email validation. This makes me think that we should somehow use email-validator directly in entrypoint instead of 2 logics to test valid email.
Instead of using two different email validations, we are now employing the email-validator package, which is already used in other parts of pgAdmin4. Therefore, the entrypoint.sh
file will only allow emails that comply with the email-validator package.
Tested with docker release candidate. Works fine.
@adityatoshniwal was able to try it today. The solution provided does not resolve the issue at hand, config_local.py does not appear to be read during the entrypoint. As such it is still impossible to allow additional domains in accordance with #6222
Reopening case for allowing the additional domains from config.py.
@adityatoshniwal was able to try it today. The solution provided does not resolve the issue at hand, config_local.py does not appear to be read during the entrypoint. As such it is still impossible to allow additional domains in accordance with #6222
I agree we missed this. I'm thinking we should introduce a new config var ALLOW_SPECIAL_EMAIL_DOMAINS = []
as an array so that users do not need to add a code snippet and would work directly using env var.
I've reopened #6222