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

[FEATURE] Opt out of SMTP validation #48

Closed
4 tasks done
giovannibonetti opened this issue Jun 13, 2019 · 7 comments
Closed
4 tasks done

[FEATURE] Opt out of SMTP validation #48

giovannibonetti opened this issue Jun 13, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@giovannibonetti
Copy link

giovannibonetti commented Jun 13, 2019

New Issue Checklist

Feature request

Hi! I really like this library, but I'm wondering if there is any drawback to using the final SMTP validation. Is it possible that the my email domain (from verifier_email) might get an increase in its spam score since the verification sends a real SMTP request for each verified email address on behalf of it?

What do you think about making SMTP validation optional and also disabling it by default if verifier_email is not set?

@bestwebua bestwebua self-assigned this Jun 14, 2019
@bestwebua
Copy link
Member

bestwebua commented Jun 14, 2019

Hello. @giovannibonetti! Thanks for your feedback. I will add default validation as configurable option in next release. At the moment you can run validation with parameter:

Truemail.validate('email@domain', with: :mx)

or configure not smtp validation for domain(s) that reject smtp validation

Truemail.configure do |config|
  config.validation_type_for = { 'somedomain.com' => :mx }
end

@bestwebua bestwebua added the enhancement New feature or request label Jun 14, 2019
@giovannibonetti
Copy link
Author

Thanks for the quick response! 😀

bestwebua added a commit that referenced this issue Jun 18, 2019
* Implement configurable default validation type
* Update gem documentation
* Update gem version
@bestwebua
Copy link
Member

bestwebua commented Jun 18, 2019

Thanks for the quick response! grinning

@giovannibonetti, this feature is available in Truemail 1.1.0 🚀 Cheers!

@giovannibonetti
Copy link
Author

Thanks, @bestwebua! 😀

By the way, do you think it makes sense to make verifier_email optional in case of mx validation?

require 'truemail'

Truemail.configure do |config|
  config.default_validation_type = :mx
end

I tried to use it like that but it still requires a verifier_email.

/usr/local/bundle/gems/truemail-1.1.0/lib/truemail.rb:45:in `raise_unless': verifier_email is required parameter (Truemail::ConfigurationError)
from /usr/local/bundle/gems/truemail-1.1.0/lib/truemail.rb:15:in `configuration'
from /usr/local/bundle/gems/truemail-1.1.0/lib/truemail.rb:21:in `configure'

I know I can just set a dummy value to config.verifier_email, but maybe it would make sense to delay the presence validation until it is actually required, which is at the moment a smtp validation is requested.

@bestwebua
Copy link
Member

Hi, @giovannibonetti! Thanks for your feedback. But what will happen if verifier_email will be an optional parameter and you will run Truemail.validate('email@email.com', with: :smtp) without configured verifier_email? Tuemail will crash. Therefore I think that verifier_email should be required parameter in any case.

@giovannibonetti
Copy link
Author

Ok, understood. Thanks for your time!

@bestwebua
Copy link
Member

bestwebua commented Jun 22, 2019

You're welcome!

@bestwebua bestwebua changed the title Feature request: opt out of SMTP validation [FEATURE] Opt out of SMTP validation Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants