-
Notifications
You must be signed in to change notification settings - Fork 376
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
Update email validation with Truemail #398
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rationale: truemail is a gem that goes above and beyond when it comes to validating email addresses. It checks the domain, the MX records, and the SMTP server to ensure that the email address is valid. We will use it to ensure that the email addresses being used by the application are valid. This will help us to avoid sending emails to invalid email addresses and improve our mail deliverability.
Changed start methods to clarify boot process: - Renamed Onetime.load! to Onetime.boot! to better reflect its purpose of initializing the application - Updated references to the boot method throughout the codebase - Added documentation to Onetime module and boot method describing the boot process This simplifies initialization and improves grokability by using more precise terminology. The name "load" was somewhat ambiguous, while "boot" more clearly conveys that the application is being started up and prepared to serve requests. "Boot" also implies there's an order of operations which is important to understand when working with the application. Notes: - No functional changes, just naming for clarity - More boot process documentation to be added
Create greetings.yml
The `OT::Config.after_load` method was added to run additional initialization tasks after loading the configuration. It extracts the `:from` email address from the config and configures TrueMail accordingly. Set TrueMail verifier email address after loading onetime configuration. This ensures the verifier email is set properly based on the config, avoiding errors during email validation.
Includes tests for existing email validation logic.
Current we're validating just the format of the email address. Let we'll leverage the Truemail gem to validate whether the email address is actually deliverable, not on a deny list, and not a temporary email address.
Update email validation with Truemail
The or-equals conditional assignment for `@email_address` could potentially carry over a value from a previous test. See: https://github.com/onetimesecret/onetimesecret/actions/runs/9485588070/job/26137975444?pr=395
…nSave Partial revert for Ruby 3 syntax changes
delano
commented
Jun 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the email validation in the codebase to use the Truemail gem. Truemail provides comprehensive email validation based on RFC 5322 and RFC 5321. It performs checks on the domain, MX records, and SMTP server to ensure that the email address is valid. By using Truemail, we can improve the robustness of our email validation and avoid sending emails to invalid addresses.
Fixes #392