fix requests not being sent to the cc recipients
From a SMTP pov, the To and Cc header are not read. The real recipient is stated at the begining of a send mail transaction. It's up to the client to collect this recipient list. Sendmail does this by reading the To and Cc header. smtplib doesn't do this when being invoked with an explicit To array. This commit adds the Cc people to the recipient array. The issue has been introduced by the switch from sendmail to smtplib.
Merge request reports
Activity
added 1 commit
- 052ed3ce - fix requests not being sent to the cc recipients
added 1 commit
- c99ec9ba - fix requests not being sent to the cc recipients
added 1 commit
- 8c41e1e6 - fix requests not being sent to the cc recipients
added 1 commit
- 04eeaf57 - fix requests not being sent to the cc recipients
added 2 commits
The more "obvious" solution would be to call smtplib with
to_addrs=None
, but then we'd implicitly send mails to Cc'ed people len(To:) times. For mails with Cc set, we currently have only one To recipient, but that might change in the future. I think that this more explicit approach is less error prone.Thanks Frederik; please run
make check
with your patches. The sendmail option is used by the test suite and cannot be removed.I also think this is exactly what I intended to do in c4f4ac51 (Deliver emails to Cc in smtplib code path, 2020-08-27); but now, looking at it again, it seems like I forgot to replace
to
bydeliver_to
in the server.sendmail() line. Or, in other words, is your patch equivalent to substitutingto
withdeliver_to
in the server.sendmail() line?added 1 commit
- ccf11e57 - fix requests not being sent to the cc recipients
This enables sendmail again and adds a small instruction to the sendmail portion to make it compatible for cases where there is only one rcpt if cc is set.
Edited by Frederik Schwanmentioned in merge request !7 (closed)
We can discuss the advantages/disadvantages and other implications of using Bcc vs. individual emails for notifications -- but that's definitely way outside the scope of a bug fix for this particular issue.
Thanks for analyzing the issue, preparing another PR and sorry for the extra work!
Edited by Lukas Fleischer