IMAP connector fails on valid From headers with quoted display names containing commas
Onyx version: 4.8.1
The IMAP connector fails while parsing a valid From header when the display name contains a comma inside quotes.
Example valid header:
"Lastname, Firstname" [email protected]
The indexing job fails with an error similar to:
RuntimeError: Expected a singular address, but instead got multiple
This appears to happen because the address parsing logic splits the raw header on commas before parsing addresses.
For a quoted display name such as:
"Lastname, Firstname" [email protected]
the comma is part of the display name and should not be treated as a separator between multiple addresses.
Expected behavior: The connector should correctly parse RFC-compliant address headers with quoted display names containing commas.
Possible fix:
Use a parser that understands RFC address syntax, such as email.utils.getaddresses(), instead of splitting the raw header string on commas manually.
The issue is reproducible with a single valid email containing the header shown above.
Source: onyx-dot-app/onyx