--- qmail-1.03/preline.c Mon Jun 15 12:53:16 1998 +++ qmail-1.03-fefe/preline.c Thu Jul 25 23:40:05 2002 @@ -20,6 +20,7 @@ int flagufline = 1; char *ufline; int flagrpline = 1; char *rpline; int flagdtline = 1; char *dtline; +int flagpipe = 0; char outbuf[SUBSTDIO_OUTSIZE]; char inbuf[SUBSTDIO_INSIZE]; @@ -41,7 +42,7 @@ if (!(rpline = env_get("RPLINE"))) die_usage(); if (!(dtline = env_get("DTLINE"))) die_usage(); - while ((opt = getopt(argc,argv,"frdFRD")) != opteof) + while ((opt = getopt(argc,argv,"frdFRDp")) != opteof) switch(opt) { case 'f': flagufline = 0; break; case 'r': flagrpline = 0; break; @@ -49,6 +50,7 @@ case 'F': flagufline = 1; break; case 'R': flagrpline = 1; break; case 'D': flagdtline = 1; break; + case 'p': flagpipe = 1; break; default: die_usage(); } argc -= optind; @@ -77,8 +79,10 @@ if (flagufline) substdio_bputs(&ssout,ufline); if (flagrpline) substdio_bputs(&ssout,rpline); if (flagdtline) substdio_bputs(&ssout,dtline); - if (substdio_copy(&ssout,&ssin) != 0) - strerr_die2sys(111,FATAL,"unable to copy input: "); + if (substdio_copy(&ssout,&ssin) != 0) { + if (errno!=error_pipe || !flagpipe) + strerr_die2sys(111,FATAL,"unable to copy input: "); + } substdio_flush(&ssout); close(1);