Skip to content

Conversation

@samarth93
Copy link

Fixes #2302

Problem

Email validation was failing for RFC-5322 compliant addresses with commas in display names, like:

The issue occurred at multiple levels:

  1. Email validation regex only validated bare addresses
  2. Email splitting used naive split(",") which broke quoted display names

Solution

  • Add extractEmailAddress() to parse the actual email from RFC-5322 format
  • Add splitEmailAddresses() that respects commas inside quotes
  • Update validateEmail() and validateEmailWithZod() to extract the email before validation
  • Update MultiSelectInput.vue to use proper email splitting

Testing

  1. Open any ticket and click Reply
  2. Enter email: "John, Doe" <[email protected]>
  3. Should be accepted without validation errors
  4. Multiple emails like "John, Doe" <[email protected]>, [email protected] should split correctly

Fixes email validation failing for addresses like "John, Doe" <[email protected]>

- Add extractEmailAddress() to parse email from RFC-5322 format
- Add splitEmailAddresses() that respects quoted commas
- Update validateEmail() to extract actual email before validation
- Update MultiSelectInput to use proper email splitting

Fixes frappe#2302
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.

Email validation issues

1 participant