/*
-** Sendmail
-** Copyright (c) 1983 Eric P. Allman
-** Berkeley, California
-**
-** Copyright (c) 1983 Regents of the University of California.
-** All rights reserved. The Berkeley software License Agreement
-** specifies the terms and conditions for redistribution.
-*/
+ * Copyright (c) 1983 Eric P. Allman
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
#ifndef lint
char copyright[] =
-"@(#) Copyright (c) 1980 Regents of the University of California.\n\
+"@(#) Copyright (c) 1988 Regents of the University of California.\n\
All rights reserved.\n";
-#endif not lint
+#endif /* not lint */
#ifndef lint
-static char SccsId[] = "@(#)main.c 5.11 (Berkeley) 1/30/86";
-#endif not lint
+static char sccsid[] = "@(#)main.c 5.18 (Berkeley) 6/30/88";
+#endif /* not lint */
-# define _DEFINE
-# include <signal.h>
-# include <sgtty.h>
-# include "sendmail.h"
+#define _DEFINE
+
+#include <signal.h>
+#include <sgtty.h>
+#include "sendmail.h"
+#include <arpa/nameser.h>
+#include <resolv.h>
# ifdef lint
char edata, end;
*/
-
-
-
int NextMailer; /* "free" index into Mailer struct */
char *FullName; /* sender's full name */
ENVELOPE BlankEnvelope; /* a "blank" envelope */
#endif SMTP
#endif DAEMON
-
-
-
-
-
main(argc, argv, envp)
int argc;
char **argv;
}
reenter = TRUE;
+ /* Enforce use of local time */
+ unsetenv("TZ");
+
/*
** Be sure we have enough file descriptors.
+ ** But also be sure that 0, 1, & 2 are open.
*/
+ i = open("/dev/null", 2);
+ while (i >= 0 && i < 2)
+ i = dup(i);
for (i = 3; i < 50; i++)
(void) close(i);
errno = 0;
OldUmask = umask(0);
OpMode = MD_DELIVER;
MotherPid = getpid();
-# ifndef V6
FullName = getenv("NAME");
-# endif V6
# ifdef LOG
openlog("sendmail", LOG_PID, LOG_MAIL);
case 'C': /* select configuration file (already done) */
break;
-# ifdef DEBUG
+#ifdef DEBUG
case 'd': /* debugging -- redo in case frozen */
tTsetup(tTdvect, sizeof tTdvect, "0-99.1");
tTflag(&p[2]);
setbuf(stdout, (char *) NULL);
+ _res.options |= RES_DEBUG;
break;
-# endif DEBUG
+#endif
case 'f': /* from address */
case 'r': /* obsolete -f flag */
{
int f;
union frz fhdr;
- extern char edata;
+ extern char edata, end;
extern char Version[];
extern caddr_t brk();