- Issue created by @hosterholz
- Status changed to Needs review
about 2 years ago 1:45pm 29 March 2023 - ๐ฌ๐งUnited Kingdom adamps
Yes you are right. It is a known and documented restriction on
MailerHelperInterface::parseAddress()
, so I would prefer to call it a feature request๐.Since #3254085: Sending mails to multiple email addresses does not work via BC โ , nearly a year ago, I've changed my views - back-compatibility mode is likely to stay around for many years, even "forever". So yes I am happy to fix this. We should use library code rather than re-inventing. I wonder about
Mail_RFC822
in package pear/mail, see docs.Thanks very much for the test. Setting to "Needs Review" so we can see that it fails๐.
- Status changed to Active
about 2 years ago 3:59pm 31 March 2023 - ๐ฌ๐งUnited Kingdom adamps
Also see
swiftmailer_parse_mailboxes()
, which is even more complex and yet still probably not fully correct or complete with the evolving standards.Thanks the patch is useful for anyone who wants a solution in the meantime. I don't feel it's right to commit it, as it seems better to use library code.
- ๐จ๐ญSwitzerland znerol
See also core fix in ๐ Uncaught RfcComplianceException when email From name contains a comma Fixed .
- ๐ฌ๐งUnited Kingdom adamps
In my testing of splitting addresses, str_getcsv() is an improvement on explode() however it's not 100%:
- it works if the display name contains a comma
- if fails if the display name contains a less-than (because it removes the quotes within each address) - ๐ฆ๐นAustria drcolossos
We had the same issue and the patch fixed the problem. As noted in #5, the str_getcsv() has an issue with "," in an address.
- ๐ฌ๐งUnited Kingdom adamps
Let's just take the Core fix
// Split values by comma, but ignore commas encapsulated in double // quotes. $value = str_getcsv($value, ',');
It goes in
ImportHelper::parseAddress()
in place ofexplode(',', $encoded)
. - First commit to issue fork.
- ๐ฌ๐งUnited Kingdom adamps
Thanks. The code in Drupal Core has recently changed to support PHP 8.4. Please can we do the same here?
$value = str_getcsv($value, escape: '\\');
- First commit to issue fork.
- ๐ฎ๐ณIndia adwivedi008
Hello @adamps
I have implemented the suggestion provided for extending support to PHP 8.4.
Please review and suggest any other changes is required
Moving the issue to Needs Review
- ๐ซ๐ทFrance prudloff Lille
Tests are failing: https://git.drupalcode.org/project/symfony_mailer/-/merge_requests/140/p...
Also the MR should probably include the new unit test from the other branch: https://git.drupalcode.org/issue/symfony_mailer-3350992/-/compare/2.x......
- ๐ฎ๐ณIndia koustav_mondal Kolkata
koustav_mondal โ changed the visibility of the branch 3350992-display-names-containing to hidden.
- ๐ฎ๐ณIndia koustav_mondal Kolkata
Hello @adwivedi008 there was some pieline issue in your code, I fixed it and also the issue was assigned to me already.
- ๐ฎ๐ณIndia koustav_mondal Kolkata
Hello @adamps, I've made the changes according to #14 . Please have a look and tell me if any other changes are required.
- ๐ฌ๐งUnited Kingdom adamps
Thanks the code looks good. I'm confused about the test - it looks like there was a commit that added tests then they were later removed. Please can you check?
MailerHelper
is now calledImportHelper
in 2.x. The constructor needs only one argument.