wswietse@eutrc3.UUCP (Wietse Venema) (04/24/88)
Problem: When smail invokes the local SysV mailer for delivery, the local mailer's standard output clobbers its standard error output, producing hard to understand error reports. Repeat by: For example, the command `mail noperson' causes smail to return the message to the originator, with the following error report: Mail saved in dead.letter on instead of: mail: can't send to noperson Mail saved in dead.letter Fix: Apply the following patch. The freopen() calls that capture the local mailer's outputs are changed from "w" (creation) mode to "a" (append) mode. This patch solves a problem I had when installing smail on a System-V/AT host. It may also be relevant for other UNIX versions. *** deliver.c- Fri Sep 25 14:44:51 1987 --- deliver.c Sat Apr 23 17:02:14 1988 *************** *** 106,114 **** (void) unlink(stderrfile); (void) strcpy(stderrfile, "/tmp/stderrXXXXXX"); (void) mktemp(stderrfile); ! (void) freopen(stderrfile, "w", stderr); if(debug != YES) { ! (void) freopen(stderrfile, "w", stdout); } *lend = *rend = *send = '\0'; --- 106,114 ---- (void) unlink(stderrfile); (void) strcpy(stderrfile, "/tmp/stderrXXXXXX"); (void) mktemp(stderrfile); ! (void) freopen(stderrfile, "a", stderr); if(debug != YES) { ! (void) freopen(stderrfile, "a", stdout); } *lend = *rend = *send = '\0'; -- uucp: mcvax!eutrc3!wswietse | Eindhoven University of Technology bitnet: wswietse@heithe5 | Dept. of Mathematics and Computer Science surf: tuerc5::wswietse | Eindhoven, The Netherlands.