Bug #92354

Bcc field gets removed

Added by Henrik Elsner 12 months ago. Updated about 1 month ago.

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

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

#1

Updated by Oliver Bartsch 12 months 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?

#2

Updated by Henrik Elsner 12 months 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.

#3

Updated by Oliver Bartsch 12 months 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();
#4

Updated by Henrik Elsner 12 months 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.

#5

Updated by Oliver Bartsch 12 months ago

  • Status changed from Resolved to Closed
#6

Updated by Frans Saris 9 months 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`

#7

Updated by Thomas Goetz 8 months 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 :)

#8

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

#9

Updated by Bjoern Jacob about 2 months 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?

#10

Updated by Riccardo De Contardi about 1 month ago

  • Category set to Form Framework

Also available in: Atom PDF