Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transport "destination" input validation to allow email addresses #2212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wedi
Copy link
Contributor

@wedi wedi commented Jan 22, 2019

Emails are allowed in transport and listed as example in the input box but they fail input validation.

…resses

Emails are allowed in [transport](http://www.postfix.org/transport.5.html) and listed as example in the input box but they fail input validation.
@wedi wedi changed the title Fix transport "destination" input field validation to allow email add… Fix transport "destination" input validation to allow email addresses Jan 22, 2019
@andryyy
Copy link
Contributor

andryyy commented Jan 22, 2019

I think we need to make sure that all validations still work when we change that. I need to check that. :) Not sure right now.

@wedi
Copy link
Contributor Author

wedi commented Jan 22, 2019

Ah ok. You believe there might be more validations in place for this string?

@andryyy
Copy link
Contributor

andryyy commented Jan 22, 2019

More validations when editing existing and adding new items. The validation function is a mess.

@wedi
Copy link
Contributor Author

wedi commented Jan 22, 2019

I saw some extensive regex here and there. Is there a minimum PHP version requirement in place? Starting at version 7 there is a FILTER_VALIDATE_DOMAIN flag as well.

@andryyy
Copy link
Contributor

andryyy commented Jan 22, 2019

Yes, but we need to remove some chars first, allow ".domain.tld" for example. But not always, it depends on other entries. Sometimes [domain.tld] is okay, sometimes domain.tld is not.

That's part of the mess I wrote about. :-)

The validation is tricky, the queries in Postfix follow a specific order, we need to check for some combinations. We cannot allow a specific entry when this or that already exists. It is difficult. We cannot just use checks like "does X already exist?" or "is X a domain?".

@wedi
Copy link
Contributor Author

wedi commented Jan 22, 2019

Are you going to look into this? You are used to the mailcow SQL foo. 🙃 Or would you be willing to merge this to allow email addresses now and add another issue for complete validation with duplicates and everything?

@andryyy
Copy link
Contributor

andryyy commented Jan 22, 2019

I will test this locally, ok? If it's fine (I think it will not break anything), I will merge it.

@wedi
Copy link
Contributor Author

wedi commented Jan 22, 2019

Editing the transport does work.

@andryyy
Copy link
Contributor

andryyy commented Jan 22, 2019

It is something Postfix-internal. The order of the queries is the problem. Your PR is fine, I just need to make sure everything Postfix does is still okay. :)

@stale
Copy link

stale bot commented Mar 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dunno label Mar 23, 2019
@wedi
Copy link
Contributor Author

wedi commented Mar 25, 2019

unstale :)

@stale stale bot removed the dunno label Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants