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

Validate email address with ParseAddress #345

Open
darksnow opened this issue Jan 13, 2023 · 2 comments
Open

Validate email address with ParseAddress #345

darksnow opened this issue Jan 13, 2023 · 2 comments

Comments

@darksnow
Copy link

darksnow commented Jan 13, 2023

Is it possible to validate email addresses using the Go built in ParseAddress function instead of a regexp?

Looking at https://cs.opensource.google/go/go/+/master:src/net/mail/message.go shows how complex correctly validating an email address is but I can't see a way to use that function in Authboss, or any regexp in the above code that I can apply to MustMatch.

Perhaps a good solution could be to add a ValidationFunction option to Rules which takes a func(string) bool

@aarondl
Copy link
Member

aarondl commented Mar 13, 2023

Sounds like a good idea.

I think we could add a bool to opt out of this functionality, but have it turned on by default and use our license for breaking changes to introduce this in a minor. It shouldn't be processing invalid ones already. Welcome a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants