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

Update regular expression for parsing recipient values #193

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewtimberlake
Copy link
Collaborator

I’ve broken the regular expression to match three distinct types of address

  1. Quoted name with address
  2. Non-quoted name with address
  3. address on it’s own

I have also changed to expanded notation to make it a little clearer.

This provides a fix for #191

NOTE: This still does not correctly parse all valid address spec values. It won’t handle comments or group syntax to name two I can immediately think of. To solve that, we’ll need a proper address spec parser

romsahel and others added 2 commits March 17, 2025 16:52
…ontaining additional quotes

Found in production, an e-mail has the 'from' field with the following value:
```ex
""[email protected]" " <[email protected]>
````

which is incorrectly parsed into `[email protected]\"` instead of
```ex
{"\"[email protected]\"", "[email protected]"}
````
I’ve broken the regular expression to match three distinct types of address

1. Quoted name with address
2. Non-quoted name with address
3. address on it’s own

I have also changed to expanded notation to make it a little clearer.
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

Successfully merging this pull request may close these issues.

2 participants