X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/8bb0f8000b86df9270f2410de3fb6f41fa63e88b..2f3e60ab51648c4e0cf0e686600428cd5f56aa66:/uip/sendsbr.c diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 4c447414..2350ccf4 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -603,6 +603,7 @@ splitmsg (char **vec, int vecp, char *drft, struct stat *st, int delay) * Scan through the message and examine the various header fields, * as well as locate the beginning of the message body. */ + m_getfld_track_filepos (&gstate, in); for (compnum = 1;;) { int bufsz = sizeof buffer; switch (state = m_getfld (&gstate, name, buffer, &bufsz, in)) { @@ -907,8 +908,10 @@ static void alert (char *file, int out) { pid_t child_id; - int i, in; + int i, in, argp; char buf[BUFSIZ]; + char *program; + char **arglist; for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); @@ -948,8 +951,14 @@ alert (char *file, int out) snprintf (buf, sizeof(buf), "send failed on %s", forwsw ? "enclosed draft" : file); - execlp (mailproc, r1bindex (mailproc, '/'), getusername (), - "-subject", buf, NULL); + arglist = argsplit(mailproc, &program, &argp); + + arglist[argp++] = getusername(); + arglist[argp++] = "-subject"; + arglist[argp++] = buf; + arglist[argp] = NULL; + + execvp (program, arglist); fprintf (stderr, "unable to exec "); perror (mailproc); _exit (-1);