go-gomail / gomail

The best way to send emails in Go.
MIT License
4.39k stars 579 forks source link

Bcc header for Message.WriteTo ? #115

Open heisGarvit opened 6 years ago

heisGarvit commented 6 years ago

The emails in Bcc headers are not populated with Message.WriteTo( ) any solution ? StackOverflow Question

kostix commented 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:

PaluMacil commented 6 years ago

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.