Open heisGarvit opened 6 years ago
As @heisGarvit was unfortunately lazy to actually formulate the problem but reached for this issue tracker as per my suggestion (given over there at SO) let me try to sketch up what the problem is—as I see it.
@heisGarvit tried to use the Message.WriteTo()
method to stream a mail message to a locally running mailer process—as opposed to talking via an MTA using SMTP protocol.
The message had the Bcc
header field populated with a set of addresses but gomail.v2
seemingly stripped this field before talking to the MTA (Exim in this case) so the latter did not send mail to those addresses.
I have a hunch that the offending piece of code is
this which explicitly drops Bcc
when streaming the message to a mail delivery agent.
If I'm correct in my assessment, I'm inclined to think that the indicated behaviour is counter-productive as there's a conceptial distinction between the two cases:
Bcc
themselves by cutting it off the header
of the message we're processing and issuing an RCPT TO
command for each
of the addresses found in the field's value.Bcc
(or any other header field, FWIW)
so cutting it off the message is a bug which prevents using Bcc
in this case.this hasn't been maintained in a very long time. The accepted fork seems to have been https://github.com/go-mail/mail for a couple years now.
The emails in Bcc headers are not populated with Message.WriteTo( ) any solution ? StackOverflow Question