- chmod (bccfil, 0600);
-
- fprintf (out, "Date: %s\n", dtimenow (0));
- if (msgflags & MFRM) {
- /* There was already a From: in the draft. Don't add one. */
- if (!draft_from_masquerading)
- /*
- * mts.conf didn't contain "masquerade:[...]draft_from[...]"
- * so we'll reveal the user's actual account@thismachine
- * address in a Sender: header (and use it as the envelope
- * From: later).
- */
- fprintf (out, "Sender: %s\n", from);
- } else
- /* Construct a From: header. */
- fprintf (out, "From: %s\n", signature);
- if (subject)
- fprintf (out, "Subject: %s", subject);
- fprintf (out, "BCC:\n\n------- Blind-Carbon-Copy\n\n");
- fflush (out);
-
- if (filter == NULL) {
- if ((fd = open (tmpfil, O_RDONLY)) == NOTOK)
- adios (NULL, "unable to re-open");
- cpydgst (fd, fileno (out), tmpfil, bccfil);
- close (fd);
- } else {
- vec[0] = r1bindex (mhlproc, '/');
-
- for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
- sleep (5);
- switch (child_id) {
- case NOTOK:
- adios ("vfork", "unable to");
-
- case OK:
- dup2 (fileno (out), 1);
-
- i = 1;
- vec[i++] = "-forward";
- vec[i++] = "-form";
- vec[i++] = filter;
- vec[i++] = tmpfil;
- vec[i] = NULL;
-
- execvp (mhlproc, vec);
- adios (mhlproc, "unable to exec");
-
- default:
- if (status = pidwait(child_id, OK))
- admonish (NULL, "%s lost (status=0%o)", vec[0], status);
- break;
- }
- }
-
- fseek (out, 0L, SEEK_END);
- fprintf (out, "\n------- End of Blind-Carbon-Copy\n");
- fclose (out);
-}
-#endif /* if 0 */
-
-/* FCC INTERACTION */
-
-static void
-file (char *path)
-{
- int i;
-
- if (fccind == 0)
- return;
-
- for (i = 0; i < fccind; i++)
- fcc (path, fccfold[i]);
-}
-
-
-static void
-fcc (char *file, char *folder)
-{
- pid_t child_id;
- int i, status;
- char fold[BUFSIZ];
-
- if (verbose)
- printf ("%sFcc: %s\n", msgstate == resent ? "Resent-" : "", folder);
- fflush (stdout);