version 1.3, 1997/07/13 21:21:16 |
version 1.4, 1997/07/13 23:54:02 |
|
|
} |
} |
if (doign != ignoreall) |
if (doign != ignoreall) |
/* add blank line */ |
/* add blank line */ |
(void) putc('\n', obuf); |
(void)putc('\n', obuf); |
ishead = 0; |
ishead = 0; |
ignoring = 0; |
ignoring = 0; |
} else { |
} else { |
|
|
if (length > 1) |
if (length > 1) |
fputs(prefix, obuf); |
fputs(prefix, obuf); |
else |
else |
(void) fwrite(prefix, sizeof(*prefix), |
(void)fwrite(prefix, sizeof(*prefix), |
prefixlen, obuf); |
prefixlen, obuf); |
(void) fwrite(line, sizeof(*line), length, obuf); |
(void)fwrite(line, sizeof(*line), length, obuf); |
if (ferror(obuf)) |
if (ferror(obuf)) |
return(-1); |
return(-1); |
} |
} |
|
|
if (c > 1) |
if (c > 1) |
fputs(prefix, obuf); |
fputs(prefix, obuf); |
else |
else |
(void) fwrite(prefix, sizeof(*prefix), |
(void)fwrite(prefix, sizeof(*prefix), |
prefixlen, obuf); |
prefixlen, obuf); |
(void) fwrite(line, sizeof(*line), c, obuf); |
(void)fwrite(line, sizeof(*line), c, obuf); |
if (ferror(obuf)) |
if (ferror(obuf)) |
return(-1); |
return(-1); |
} |
} |
|
|
grabh(hp, GBCC); |
grabh(hp, GBCC); |
} else { |
} else { |
puts("EOT"); |
puts("EOT"); |
(void) fflush(stdout); |
(void)fflush(stdout); |
} |
} |
if (fsize(mtf) == 0) |
if (fsize(mtf) == 0) |
if (hp->h_subject == NOSTR) |
if (hp->h_subject == NOSTR) |
|
|
goto out; |
goto out; |
} |
} |
if ((cp = value("record")) != NOSTR) |
if ((cp = value("record")) != NOSTR) |
(void) savemail(expand(cp), mtf); |
(void)savemail(expand(cp), mtf); |
/* |
/* |
* Fork, set up the temporary mail file as standard |
* Fork, set up the temporary mail file as standard |
* input for "mail", and exec with the user list we generated |
* input for "mail", and exec with the user list we generated |
|
|
_exit(1); |
_exit(1); |
} |
} |
if (value("verbose") != NOSTR) |
if (value("verbose") != NOSTR) |
(void) wait_child(pid); |
(void)wait_child(pid); |
else |
else |
free_child(pid); |
free_child(pid); |
out: |
out: |
|
|
(void)Fclose(nfo); |
(void)Fclose(nfo); |
return(fi); |
return(fi); |
} |
} |
(void) rm(tempMail); |
(void)rm(tempMail); |
(void) puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GNL|GCOMMA); |
(void)puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GNL|GCOMMA); |
c = getc(fi); |
c = getc(fi); |
while (c != EOF) { |
while (c != EOF) { |
(void) putc(c, nfo); |
(void)putc(c, nfo); |
c = getc(fi); |
c = getc(fi); |
} |
} |
if (ferror(fi)) { |
if (ferror(fi)) { |
|
|
rewind(fi); |
rewind(fi); |
return(fi); |
return(fi); |
} |
} |
(void) fflush(nfo); |
(void)fflush(nfo); |
if (ferror(nfo)) { |
if (ferror(nfo)) { |
warn(tempMail); |
warn(tempMail); |
(void)Fclose(nfo); |
(void)Fclose(nfo); |
|
|
if (hp->h_bcc != NIL && w & GBCC) |
if (hp->h_bcc != NIL && w & GBCC) |
fmt("Bcc:", hp->h_bcc, fo, w&GCOMMA), gotcha++; |
fmt("Bcc:", hp->h_bcc, fo, w&GCOMMA), gotcha++; |
if (gotcha && w & GNL) |
if (gotcha && w & GNL) |
(void) putc('\n', fo); |
(void)putc('\n', fo); |
return(0); |
return(0); |
} |
} |
|
|
|
|
warn(name); |
warn(name); |
return(-1); |
return(-1); |
} |
} |
(void) time(&now); |
(void)time(&now); |
fprintf(fo, "From %s %s", myname, ctime(&now)); |
fprintf(fo, "From %s %s", myname, ctime(&now)); |
while ((i = fread(buf, 1, sizeof(buf), fi)) > 0) |
while ((i = fread(buf, 1, sizeof(buf), fi)) > 0) |
(void) fwrite(buf, 1, i, fo); |
(void)fwrite(buf, 1, i, fo); |
(void) putc('\n', fo); |
(void)putc('\n', fo); |
(void) fflush(fo); |
(void)fflush(fo); |
if (ferror(fo)) |
if (ferror(fo)) |
warn(name); |
warn(name); |
(void)Fclose(fo); |
(void)Fclose(fo); |