stdin (to fix some problems with saving mail on interrupts)
SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.16
SCCS-vsn: usr.sbin/sendmail/src/conf.c 3.19
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.25
SCCS-vsn: usr.sbin/sendmail/src/collect.c 3.16
SCCS-vsn: usr.sbin/sendmail/src/err.c 3.9
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.28
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 3.18
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 3.13
SCCS-vsn: usr.sbin/sendmail/src/main.c 3.22
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 3.10
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.3
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.4
12 files changed:
-# include <stdio.h>
-# include <ctype.h>
# include <pwd.h>
# include "sendmail.h"
# ifdef DBM
# include <pwd.h>
# include "sendmail.h"
# ifdef DBM
-static char SccsId[] = "@(#)alias.c 3.15 %G% (with DBM)";
+static char SccsId[] = "@(#)alias.c 3.16 %G% (with DBM)";
-static char SccsId[] = "@(#)alias.c 3.15 %G% (without DBM)";
+static char SccsId[] = "@(#)alias.c 3.16 %G% (without DBM)";
-# include <stdio.h>
-# include <ctype.h>
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)collect.c 3.15 %G%";
+static char SccsId[] = "@(#)collect.c 3.16 %G%";
/*
** COLLECT -- read & parse message header & make temp file.
/*
** COLLECT -- read & parse message header & make temp file.
*/
long MsgSize; /* size of message in bytes */
*/
long MsgSize; /* size of message in bytes */
+FILE *TempFile; /* the tempfile (after creation) */
maketemp(from)
char *from;
maketemp(from)
char *from;
.... so we will ignore the problem for the time being */
}
.... so we will ignore the problem for the time being */
}
- if (freopen(InFileName, "r", stdin) == NULL)
+ if ((TempFile = fopen(InFileName, "r")) == NULL)
syserr("Cannot reopen %s", InFileName);
# ifdef DEBUG
syserr("Cannot reopen %s", InFileName);
# ifdef DEBUG
# include <pwd.h>
# include "sendmail.h"
# include <pwd.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)conf.c 3.18 %G%";
+static char SccsId[] = "@(#)conf.c 3.19 %G%";
# include <whoami.h> /* definitions of machine id's at berkeley */
# include <whoami.h> /* definitions of machine id's at berkeley */
-# include <stdio.h>
-# include <pwd.h>
# include <errno.h>
# include "sendmail.h"
# ifdef LOG
# include <syslog.h>
# endif LOG
# include <errno.h>
# include "sendmail.h"
# ifdef LOG
# include <syslog.h>
# endif LOG
-static char SccsId[] = "@(#)deliver.c 3.24 %G%";
+static char SccsId[] = "@(#)deliver.c 3.25 %G%";
/*
** DELIVER -- Deliver a message to a particular address.
/*
** DELIVER -- Deliver a message to a particular address.
fprintf(fp, "\n");
/* output the body of the message */
fprintf(fp, "\n");
/* output the body of the message */
- rewind(stdin);
- while (!ferror(fp) && (i = fread(buf, 1, BUFSIZ, stdin)) > 0)
+ rewind(TempFile);
+ while (!ferror(fp) && (i = fread(buf, 1, BUFSIZ, TempFile)) > 0)
(void) fwrite(buf, 1, i, fp);
if (ferror(fp) && errno != EPIPE)
(void) fwrite(buf, 1, i, fp);
if (ferror(fp) && errno != EPIPE)
-# include <stdio.h>
-# include <ctype.h>
# include "sendmail.h"
# ifdef LOG
# include <syslog.h>
# endif LOG
# include "sendmail.h"
# ifdef LOG
# include <syslog.h>
# endif LOG
-static char SccsId[] = "@(#)err.c 3.8 %G%";
+static char SccsId[] = "@(#)err.c 3.9 %G%";
-# include <stdio.h>
-# include <ctype.h>
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)headers.c 3.2 %G%";
+static char SccsId[] = "@(#)headers.c 3.3 %G%";
/*
** CHOMPHEADER -- process and save a header line.
/*
** CHOMPHEADER -- process and save a header line.
# include <pwd.h>
# include "sendmail.h"
# ifdef LOG
# include <syslog.h>
# endif LOG
# include <pwd.h>
# include "sendmail.h"
# ifdef LOG
# include <syslog.h>
# endif LOG
-static char SccsId[] = "@(#)main.c 3.21 %G%";
+static char SccsId[] = "@(#)main.c 3.22 %G%";
/*
** SENDMAIL -- Post mail to a set of destinations.
/*
** SENDMAIL -- Post mail to a set of destinations.
-# include <stdio.h>
-# include <ctype.h>
-static char SccsId[] = "@(#)parseaddr.c 3.17 %G%";
+static char SccsId[] = "@(#)parseaddr.c 3.18 %G%";
/*
** PARSE -- Parse an address
/*
** PARSE -- Parse an address
-static char SccsId[] = "@(#)readcf.c 3.9 %G%";
+static char SccsId[] = "@(#)readcf.c 3.10 %G%";
/*
** READCF -- read control file.
/*
** READCF -- read control file.
-# include <signal.h>
-# include <ctype.h>
-# include <errno.h>
-# ifdef LOG
-# include <syslog.h>
-# endif LOG
-static char SccsId[] = "@(#)recipient.c 3.3 %G%";
+static char SccsId[] = "@(#)recipient.c 3.4 %G%";
/*
** SENDTO -- Designate a send list.
/*
** SENDTO -- Designate a send list.
# include <pwd.h>
# include "sendmail.h"
# include <pwd.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)savemail.c 3.12 %G%";
+static char SccsId[] = "@(#)savemail.c 3.13 %G%";
/*
** SAVEMAIL -- Save mail on error
/*
** SAVEMAIL -- Save mail on error
extern char *ttypath();
static int exclusive;
extern char *ttypath();
static int exclusive;
+ if (exclusive++ || TempFile == NULL)
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
-** @(#)sendmail.h 3.27 %G%
+** @(#)sendmail.h 3.28 %G%
+# include <stdio.h>
+# include <ctype.h>
extern int ExitStat; /* exit status code */
extern char InFileName[]; /* input file name */
extern char Transcript[]; /* the transcript file name */
extern int ExitStat; /* exit status code */
extern char InFileName[]; /* input file name */
extern char Transcript[]; /* the transcript file name */
+extern FILE *TempFile; /* mail temp file */
extern ADDRESS From; /* the person it is from */
extern char *To; /* the target person */
extern int HopCount; /* hop count */
extern ADDRESS From; /* the person it is from */
extern char *To; /* the target person */
extern int HopCount; /* hop count */