Project

General

Profile

Actions

Task #92354

closed

Documentation: Bcc field gets removed

Added by Henrik Elsner over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Form Framework
Target version:
-
Start date:
2020-09-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:
Remote Sprint

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');

Actions #1

Updated by Oliver Bartsch over 3 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?

Actions #2

Updated by Henrik Elsner over 3 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.

Actions #3

Updated by Oliver Bartsch over 3 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();
Actions #4

Updated by Henrik Elsner over 3 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.

Actions #5

Updated by Oliver Bartsch over 3 years ago

  • Status changed from Resolved to Closed
Actions #6

Updated by Frans Saris over 3 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`

Actions #7

Updated by Thomas Anders over 3 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 :)

Actions #8

Updated by Frans Saris almost 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

Actions #9

Updated by Björn Jacob over 2 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?

Actions #10

Updated by Riccardo De Contardi over 2 years ago

  • Category set to Form Framework
Actions #11

Updated by Jonas Eberle over 2 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.

Actions #12

Updated by Jonas Eberle over 2 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.

Actions #13

Updated by Jonas Eberle over 2 years ago

Sorry, I forgot the link if somebody wants to speak up: https://github.com/symfony/symfony/pull/39744

Actions #14

Updated by Björn Jacob about 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.

Actions #15

Updated by Björn Jacob about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Björn Jacob
Actions #16

Updated by Gerrit Code Review about 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

Actions #17

Updated by Gerrit Code Review about 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

Actions #18

Updated by Gerrit Code Review about 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

Actions #19

Updated by Björn Jacob about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #20

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF