Task #92354
closedDocumentation: Bcc field gets removed
100%
Description
Setup:
EXT:form with a form that includes a emailfinisher (receiver or sender, not relevant)
It seems like the BCC field of a mail gets removed/not evaluated when sending a mail.
My current guess is the following segment:
vendor/symfony/mime/Message.php:99 >>> // remove the Bcc field which should NOT be part of the sent message $headers->remove('Bcc');
Updated by Oliver Bartsch about 4 years ago
- Status changed from New to Needs Feedback
Hi,
the removal of the BCC Header is correct as you can see in https://tools.ietf.org/html/rfc2822#section-3.6.3.
The "Bcc:" field (where the "Bcc" means "Blind Carbon Copy") contains addresses of recipients of the message whose addresses are not to be revealed to other recipients of the message.
Are you sure the mail is not sent to the bcc address or do you only miss the header while testing e.g. locally with mailhog?
Updated by Henrik Elsner about 4 years ago
Hi,
both is the case.
I tested locally but also in production.
The BCC recipient does not get the mail, in mailhog the header is missing.
With the adaption of the displayed segment the BCC header appears in mailhog, but also works on production.
Myself is the normal recipient/customer and a cannot see the BCC recipient.
Updated by Oliver Bartsch about 4 years ago
I unfortunately can't reproduce this issue.
The BCC recipient does not get the mail, in mailhog the header is missing.
The missing header is the correct behaviour (see RFC from my previous comment).
With the adaption of the displayed segment the BCC header appears in mailhog, but also works on production.
The mentioned line is only relevant for the mail content, send to each recipient (Thats why the BCC header is removed) and is not used for selecting to which addresses the mail should be sent. This information is gathered beforehand and stored in Symfony\Component\Mailer\Envelope.
Have you tried creating and sending your own MailMessage so we can rule out a general issue in the TYPO3 mail implementation?
Something like (Out of my head):
GeneralUtility::makeInstance(MailMessage::class)->from()->to()->bcc()->subject()->send();
Updated by Henrik Elsner about 4 years ago
- Status changed from Needs Feedback to Resolved
ok, we debugged through the whole thing once again.
The issue seems to be with symfony removing the header but not looping over each recipient.
With the setting "sendmail -bs" everything worked, before that we had "sendmail -t -i" which did not work.
Updated by Oliver Bartsch about 4 years ago
- Status changed from Resolved to Closed
Updated by Frans Saris almost 4 years ago
- Status changed from Closed to New
When using the `-bs` params you tell TYPO3/Symfony to use the SMTP standard and then the BCC is properly set.
For the `-t -i` (default value until 9 LTS) the BCC is currently broken as `Symfony` always removes the `BCC:` header https://github.com/symfony/symfony/issues/36333
I would suggest to keep this open for others running into this until a fix is provided in `Symfony/Mail`
Updated by Thomas Anders almost 4 years ago
When using the `-bs` params you tell TYPO3/Symfony to use the SMTP standard and then the BCC is properly set.
Is there some more configuration needed to make sendmail work with -bs ?
I only get " Connection to "process /usr/sbin/sendmail -bs" has been closed unexpectedly. "
(Mittwald Managed Server)
With -i its working. I do not need the BCC in that project, but it would be great to know it works, when its needed :)
Updated by Frans Saris over 3 years ago
Issue is still not resolved see https://github.com/symfony/symfony/pull/39744
When using the `-bs` option you probably need to pass an SMTP `user:password` as it uses a `SMTP` connection. At least we have that requirement on a Hetzner managed server
Updated by Björn Jacob over 3 years ago
- Category deleted (
Form Framework)
Removed the category "Form Framework". I even tend to close this issue since it is a problem of Symfony. Do you agree?
Updated by Riccardo De Contardi over 3 years ago
- Category set to Form Framework
Updated by Jonas Eberle about 3 years ago
Although not a bug in TYPO3, I would not have found the cause and solution if this was already closed.
sendmail_command="/usr/sbin/sendmail -bs"
works around the problem.
Updated by Jonas Eberle about 3 years ago
It is discussed if symfony/mailer could deprecate support for Bcc: with sendmail -t
.
As far as I checked, TYPO3 default configuration and docs suggests that anyways already.
Updated by Jonas Eberle about 3 years ago
Sorry, I forgot the link if somebody wants to speak up: https://github.com/symfony/symfony/pull/39744
Updated by Björn Jacob over 2 years ago
- Tracker changed from Bug to Task
- Subject changed from Bcc field gets removed to Documentation: Bcc field gets removed
- Sprint Focus set to Remote Sprint
Will add a note about this to the form documentation. The note should link to https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Mail/Index.html. Over there the problem should be explained in more detail.
Updated by Björn Jacob over 2 years ago
- Status changed from New to In Progress
- Assignee set to Björn Jacob
Updated by Gerrit Code Review over 2 years ago
- Status changed from In Progress to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73697
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73697
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73656
Updated by Björn Jacob over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 847183d9e5e55957d5e738ebaeeec811cf8d492d.