Several commands use a regexp to filter out Bcc fields:
someString.replaceAll(
RegExp('^Bcc:.*\r\n', multiLine: true),
'',
)
This fails when there are multiple recipients in the Bcc field, which may be spread across several lines, hence their addresses are interpreted as items for the previous field, From in my case. Since my smtp server already deleted Bcc data, this replacement has the opposite effect as desired.
I've found 4 places where this mistake was made: SmtpSendBdatMailCommand, SmtpSendBdatMailDataCommand, SmtpSendMailDataCommand, and SmtpSendMailCommand. I do not know if this list is complete, but I would suggest also DRYing up this bit of code.
Several commands use a regexp to filter out Bcc fields:
This fails when there are multiple recipients in the Bcc field, which may be spread across several lines, hence their addresses are interpreted as items for the previous field, From in my case. Since my smtp server already deleted Bcc data, this replacement has the opposite effect as desired.
I've found 4 places where this mistake was made:
SmtpSendBdatMailCommand,SmtpSendBdatMailDataCommand,SmtpSendMailDataCommand, andSmtpSendMailCommand. I do not know if this list is complete, but I would suggest also DRYing up this bit of code.