-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Email addresses validated despite cleared validation criteria #167
Comments
What's the use case for global control settings? Why not always check everything? |
To override email validation of addresses (for I18N purposes as per #166) yet keep attack validations. If there's a way to support I18N, as per the RFCs, then separating them is not a huge issue. |
This is already possible: currentMailerBuilder
.clearEmailAddressCriteria()
(..) This tells Simple Java Mail that there is no email address criteria to check and so will omit email address validation completely, yet keep the injection tests. Does this solve your problem? |
@DaveJarvis, had any luck with this yet? |
Didn't seem to help with the email address validation; if anything, clearing out the criteria made matters worse. Here's the code:
Here's the exception from the unit test:
From Mailer.java, lines 278 to 280:
So even with When I remove the In both cases (with or without the |
The reason is because of the following line:
There's no way to set the Calling
This creates a non-
Or, with a slight maintainability improvement:
With the addition of a |
This is related to issue #121. |
Your analyses is spot on. Moreover Released fix in 5.0.6, please confirm. |
https://github.com/bbottema/simple-java-mail/blob/master/src/main/java/org/simplejavamail/mailer/Mailer.java#L275
The
validate
method tightly couples validation for injection attacks alongside email addresses validation. These are different types of validation. Consider:This would allow for global settings to control validation. For example:
The text was updated successfully, but these errors were encountered: