- if (subject) {
- fprintf(out, "Subject: BCC: %s", subject);
- } else {
- fprintf(out, "Subject: BCC: message without subject");
+ for (mp=bccs; mp; mp=mp->m_next) {
+ /*
+ ** Note: This draft file will be left existing by send(1),
+ ** although renamed with backup prefix.
+ ** TODO: We should have it removed eventually.
+ */
+ bccdraft = getcpy(m_mktemp2("/tmp/", invo_name, NULL, &out));
+ fprintf(out, "To: %s\n", mp->m_text);
+ fprintf(out, "Subject: [BCC] %s", subject ? subject : "");
+ fprintf(out, "%s: %s\n", attach_hdr, origmsg);
+ fprintf(out, "------------\n");
+ fclose(out);
+
+ snprintf(buf, sizeof buf, "send %s", bccdraft);
+ if (system(buf) != 0) {
+ admonish(invo_name, "Problems to send Bcc to %s",
+ mp->m_text);
+ unlink(bccdraft);
+ }
+ /* TODO: unlink renamed bcc draft after send(1) */