-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
EmailValidator checkMX and checkPort #1246
Comments
I'm fine with what you suggested. |
I'd personaly vote for removing the checkPort feature as it has the drawbacks described above. |
What about the code in yiisoft/yii#718? |
The code would work but it is about the general idea which is bad imo. Even if the MX is down right now because of temporary error the mail could be delivered in an hour for example. |
Those are excellent points. But I think it should be left to the user to decide if it's worth the risk. Some people want rigid checks and are ok with some "losses." Having said this, I think nonetheless DNS and port checking could be improved in the way @cebe described. |
As I think those people do not understand what they are doing so they are not really okay with the "losses". Will remove the port checking. If someone really wants to do something like that he can extend the validator but we do not encourage this practise. |
I'd like to discuss the EmailValidator options checkMX and checkPort.
In the current implementation they are very useless as they do not comply to any standard and will fail on valid email adresses.
checkMX
currently checks whether an MX is defined. That's fine as a good DNS setup should involve an MX entry even if the MX server is the same server that the A record of the Domain points to but there is no must have for an MX.checkPort
is completely useless as it currently checks whether port 25 is open on the server that's behind the A record of a domain an not behind the MX. If MX is defined it is very likely that there is no port 25 open on the webserver and no MTA will try to deliver to A record when MX is defined.We should either drop these options or implement them in a better way.
I propose the following changes:
checkMX
optioncheckDNSDomain
or similar name that checks wether the domain exists in DNS. This is much more useful than checking whether there is MX or not. Note that there is no need for a A record. It should check whether A or MX are defined.The text was updated successfully, but these errors were encountered: