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

bugfix/allow-plus-characters-in-email #197

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aarondl
Copy link

@aarondl aarondl commented Dec 8, 2024

In the RFC, these characters are allowed in the local part. I was using this for testing and found that + didn't work, however that's a pretty commonly used character in email addresses. When I looked into the spec I found that there were many characters that are valid and so I added them to the regex alongside +.

PR Details

This updates the email regex pattern to be more accepting of valid email addresses. Specifically allowing ones with +, but other RFC defined characters as well.

Motivation and Context

The regex was incorrect according to the RFC, to allow more valid tests to execute against this server the email regex had to be adjusted.

How Has This Been Tested

It was tested by executing a test against the server with the kind of email in question. You can also note that the only thing that's changed is the regex and you can see that it works with any Go regex tester tool and produces the desired results.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my changes
  • I have run golangci-lint run from the root directory to see all new and existing tests pass
  • I have run go tool cover to avoid test coverage degradation

Sorry, something went wrong.

In the RFC, these characters are allowed in the local part. I was
using this for testing and found that `+` didn't work, however that's a
pretty commonly used character in email addresses. When I looked into
the spec I found that there were many characters that are valid and so I
added them to the regex.
@till
Copy link

till commented Jan 14, 2025

@bestwebua Hey 👋🏼 — hope I am not overstepping. Could you take a look? It seems like 2.4.0 breaks this. We also use a + in the "from" email and it fails:

gomail: could not send email 1: 501 MAIL FROM requires valid email address

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

Successfully merging this pull request may close these issues.

None yet

2 participants