Closed (duplicate)
Project:
Drupal core
Version:
8.6.x-dev
Component:
mail system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2016 at 16:36 UTC
Updated:
6 Feb 2023 at 01:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
arknoll commentedComment #3
arknoll commentedComment #5
arknoll commentedFix tests.
Comment #6
arknoll commentedComment #7
hgoto commentedI tested the patch #5 and it fixes the point.
I wonder if we should consider a case that a site name has some double quote characters in it. If I understand it correctly, I'd like someone to review this revised patch. This patch adds a logic to escape double quotes and a test for that to the patch #5.
Comment #10
liam morlandThis looks like a duplicate of #2717965: Site name is not UTF-8 encoded in email headers. Please try the latest patch in that issue.
Comment #11
Anthony Fok commentedHello Liam,
For better or for worse, this issue is not a duplicate of #2717965, and the latest patch there does not solve this "comma in site name" issue. I just tested it with Drupal 8.3.2.
That said, the patches for both issues would involve modifying lines of code in the same vicinity.
Comment #12
liam morlandOK. I think this would be easier to fix if the other issue is fixed first to avoid overlapping patches. Could you do a review of the other patch?
Comment #14
ben coleman commentedI just ran into this myself, and the problem is independent of the mailer module used. i can duplicate this on stock D8, though then whether or not the email goes through depends on the target mail server (e.g. in my case, emails to @gmail.com addresses get bounced for having multiple from addresses, as the local Postfix takes each word before the comma as a local username and tacks @~local server name~ on it).
The workaround, of course, is to take the comma out of the site name, for now.
Comment #15
colorfulcoder commentedWorking on triaging this issue during Vienna2017. Together with @Anna_Radulovski.
Comment #16
colorfulcoder commentedWe have trouble recreating this bug, because we don't know which mailservices are using an RFC 822 compatible mailbox parser.
It would be great to get some suggestions for which mailservice to use (Gmail, Hotmail, etc.), or instructions on how to find out if a mailservice is using an RFC 822 compatible mailbox parser.
If anyone has suggestions for a local mailservice (like mailcatcher for instance) that is using an RFC 822 compatible mailbox parser, that would be even better.
Comment #17
colorfulcoder commentedUpdated the Issue Summary as suggested by comment #14
Comment #18
liam morlandYou could also add some debugging output to MailManager::doMail() and observe that the headers are not encoded properly.
Comment #20
timodwhit commentedIt looks as though the patches are no longer valid with the unicode work being pulled into core. Updating issue.
Comment #21
yogeshmpawarComment #22
yogeshmpawarComment #24
yogeshmpawarUpdated patch will pass the test with interdiff.
Comment #26
yogeshmpawarOne more try
Comment #27
liam morlandI think if you are always using mimeHeaderEncode(), then you don't need to replace '"' with '\"'; the quotes will be escaped anyway.
But, do we want all site names, even ones with nothing but letters and numbers, to go through mimeHeaderEncode()?
Comment #28
borisson_I don't think the actual case of a comma is tested in the test in #26, the site name has a period but not a comma.
Should we change the description or the test?
Comment #29
borisson_Goes over 80 cols.
This does not have a comma, and the title of the issue is about a comma, so we should have a testcase that also has a comma.
Comment #30
allella commentedComment #31
allella commentedThere are a couple duplicates out there, which I've just associated with this issue.
There's a critical point made by longwave in comment #10 of issue 2898750
in that MIME encoded headers / words should not be quoted.
I shared a couple variations on that thread of how to detect an ASCII-only site name and then quote and quote-escape the value only if it's ASCII.
RFC2047 is focused on "textual header information in character sets other than US-ASCII" and the MIME standards all seem to address non-ASCII formats so tampering with mimeHeaderEncode() seems inappropriate since the method and the RFC it references are geared to non-ASCII. So, this would mean a fix that involves MailManager::doMail().
or a variation
This also begs the question of if the $reply variable in doMail() also needs to get the same treatment as the From because Reply-To also allows for a name portion before the email address.
Comment #33
sjerdoThis seems to have been fixed in #2936032: Sites named with special characters cannot send mail. Closing this issue as duplicate.
Comment #34
mlncn commentedThe need for a test with a comma in it needed to be brought over to the other issue before this was closed as a duplicate.
Exact same problem causing fatal errors on site due to #3226117: Uncaught RfcComplianceException when email From name contains a comma
That one does have the test, so nothing to do here although i found this issue 20 minutes before finding the other, so, leaving the link here for future me and the note about getting the experienced problem cases into tests for everybody.