Multiple Levels of Escaped Quotes Added to Recipient Address

Description

When replying to certain email addresses (seemingly addresses with brackets in the name), quotes are added around the recipient name portion of the address in the To field. When replying again in the same thread, the original quotes remain and are escaped, then additional quotes are added for each reply. The result is multiple layers of quotes and backslashes in the recipient address. For example, CEO [John Doe] email@whatever.com becomes “CEO [John Doe]” <…> becomes ““CEO [John Doe]”” etc.

This seems to happen when the address includes brackets. It may additionally happen with parentheses or other characters, not confirmed.

A further issue - when the recipient is “expanded” by double clicking to show the actual text of the address, the quotes are initially present. If it is then closed by clicking elsewhere then expanded again, the quotes are no longer added.

To Reproduce…

Steps to reproduce the behavior:

  1. In an email thread where the sender has brackets in their name, e.g. CEO [John Doe] email@adddress.com
  2. Reply to the email without expanding the recipient address
  3. Quotes are added to the recipient name
  4. Receive a response
  5. Reply again
  6. The original quotes remain and are escaped, additional level of quotes is added

Expected Behavior

Quotes are not added to recipient names with brackets, or else only one level of quotes is added and additional levels are not added on further replies.

Screenshots

quotes1
quotes2

Setup

  • OS and Version: Windows 10 22H2
  • Installation Method: installer
  • Mailspring Version: 1.14.0