SCCS-vsn: usr.sbin/sendmail/src/useful.h 4.7
SCCS-vsn: usr.sbin/sendmail/src/headers.c 5.25
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 5.24
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 5.37
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.59
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 5.32
SCCS-vsn: usr.sbin/sendmail/src/conf.h 5.28
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 5.25
SCCS-vsn: usr.sbin/sendmail/src/err.c 5.15
SCCS-vsn: usr.sbin/sendmail/src/collect.c 5.14
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.123
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 5.40
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 5.21
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 5.51
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 5.39
SCCS-vsn: usr.sbin/sendmail/src/clock.c 5.11
SCCS-vsn: usr.sbin/sendmail/src/util.c 5.32
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.48
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.66
SCCS-vsn: usr.sbin/sendmail/src/queue.c 5.50
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.43
SCCS-vsn: usr.sbin/sendmail/src/alias.c 5.38
SCCS-vsn: usr.sbin/sendmail/src/udb.c 5.20
23 files changed:
#ifndef lint
#ifdef NEWDB
#ifndef lint
#ifdef NEWDB
-static char sccsid[] = "@(#)alias.c 5.37 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c 5.38 (Berkeley) %G% (with NEWDB)";
-static char sccsid[] = "@(#)alias.c 5.37 (Berkeley) %G% (with DBM)";
+static char sccsid[] = "@(#)alias.c 5.38 (Berkeley) %G% (with DBM)";
-static char sccsid[] = "@(#)alias.c 5.37 (Berkeley) %G% (without DBM)";
+static char sccsid[] = "@(#)alias.c 5.38 (Berkeley) %G% (without DBM)";
#endif
#endif
#endif /* not lint */
#endif
#endif
#endif /* not lint */
#ifdef LOG
if (LogLevel >= 7)
syslog(LOG_INFO, "rebuilding alias database");
#ifdef LOG
if (LogLevel >= 7)
syslog(LOG_INFO, "rebuilding alias database");
}
else
{
#ifdef LOG
if (LogLevel >= 7)
syslog(LOG_INFO, "alias database out of date");
}
else
{
#ifdef LOG
if (LogLevel >= 7)
syslog(LOG_INFO, "alias database out of date");
message(Arpa_Info, "Warning: alias database out of date");
}
}
message(Arpa_Info, "Warning: alias database out of date");
}
}
syslog(LOG_NOTICE, "alias database %srebuilt by %s",
automatic ? "auto" : "", username());
}
syslog(LOG_NOTICE, "alias database %srebuilt by %s",
automatic ? "auto" : "", username());
}
readaliases(aliasfile, TRUE, e);
}
readaliases(aliasfile, TRUE, e);
}
readaliases(aliasfile, init, e);
readaliases(aliasfile, init, e);
}
\f/*
** READALIASES -- read and process the alias file.
}
\f/*
** READALIASES -- read and process the alias file.
/*
** If initializing, create the new DBM files.
/*
** If initializing, create the new DBM files.
int lhssize, rhssize;
LineNumber++;
int lhssize, rhssize;
LineNumber++;
+ p = strchr(line, '\n');
if (p != NULL)
*p = '\0';
switch (line[0])
if (p != NULL)
*p = '\0';
switch (line[0])
{
s = stab(al.q_user, ST_ALIAS, ST_ENTER);
s->s_alias = newstr(rhs);
{
s = stab(al.q_user, ST_ALIAS, ST_ENTER);
s->s_alias = newstr(rhs);
/* restore the old signal */
(void) signal(SIGINT, oldsigint);
}
/* restore the old signal */
(void) signal(SIGINT, oldsigint);
}
/* closing the alias file drops the lock */
(void) fclose(af);
/* closing the alias file drops the lock */
(void) fclose(af);
if (LogLevel >= 8)
syslog(LOG_INFO, "%d aliases, longest %d bytes, %d bytes total",
naliases, longest, bytes);
if (LogLevel >= 8)
syslog(LOG_INFO, "%d aliases, longest %d bytes, %d bytes total",
naliases, longest, bytes);
}
\f/*
** FORWARD -- Try to forward mail
}
\f/*
** FORWARD -- Try to forward mail
-static char sccsid[] = "@(#)clock.c 5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)clock.c 5.11 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
#ifdef SIGVTALRM
/* reset 4.2bsd signal mask to allow future alarms */
(void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
#ifdef SIGVTALRM
/* reset 4.2bsd signal mask to allow future alarms */
(void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
f = ev->ev_func;
arg = ev->ev_arg;
f = ev->ev_func;
arg = ev->ev_arg;
-static char sccsid[] = "@(#)collect.c 5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)collect.c 5.14 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
goto readerr;
fixcrlf(buf, FALSE);
}
goto readerr;
fixcrlf(buf, FALSE);
}
/*
** Copy InChannel to temp file & do message editing.
/*
** Copy InChannel to temp file & do message editing.
char junkbuf[MAXLINE], *sfgets();
register char *p = buf;
char junkbuf[MAXLINE], *sfgets();
register char *p = buf;
- while (index(p, '\n') == NULL) {
+ while (strchr(p, '\n') == NULL) {
if (sfgets(junkbuf,MAXLINE,fp) == NULL)
return(FALSE);
p = junkbuf;
if (sfgets(junkbuf,MAXLINE,fp) == NULL)
return(FALSE);
p = junkbuf;
-static char sccsid[] = "@(#)conf.c 5.42 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 5.43 (Berkeley) %G%";
#endif /* not lint */
# include <sys/ioctl.h>
#endif /* not lint */
# include <sys/ioctl.h>
/* NoReturn = TRUE; to supress return copy */
return (FALSE);
}
/* NoReturn = TRUE; to supress return copy */
return (FALSE);
}
+# endif /* EXAMPLE_CODE */
p = &Argv[0][i];
while (p < LastArgv)
*p++ = ' ';
p = &Argv[0][i];
while (p < LastArgv)
*p++ = ' ';
+# endif /* SETPROCTITLE */
}
\f/*
** REAPCHILD -- pick up the body of my child, lest it become a zombie
}
\f/*
** REAPCHILD -- pick up the body of my child, lest it become a zombie
while (wait3((int *)&status, WNOHANG, (struct rusage *) NULL) > 0)
continue;
while (wait3((int *)&status, WNOHANG, (struct rusage *) NULL) > 0)
continue;
auto int status;
while (wait((int *)&status) > 0)
continue;
auto int status;
while (wait((int *)&status) > 0)
continue;
}
\f/*
** UNSETENV -- remove a variable from the environment
}
\f/*
** UNSETENV -- remove a variable from the environment
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)conf.h 5.27 (Berkeley) %G%
+ * @(#)conf.h 5.28 (Berkeley) %G%
#ifndef lint
#ifdef DAEMON
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 5.50 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 5.51 (Berkeley) %G% (with daemon mode)";
-static char sccsid[] = "@(#)daemon.c 5.50 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 5.51 (Berkeley) %G% (without daemon mode)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
severe:
# ifdef LOG
if (LogLevel > 0)
severe:
# ifdef LOG
if (LogLevel > 0)
if (host[0] == '[')
{
long hid;
if (host[0] == '[')
{
long hid;
- register char *p = index(host, ']');
+ register char *p = strchr(host, ']');
- if ((cp = index(strcpy(ptr, hbuf), ']')) == NULL)
+ if ((cp = strchr(strcpy(ptr, hbuf), ']')) == NULL)
return (NULL);
*cp = '\0';
in_addr = inet_addr(&ptr[1]);
return (NULL);
*cp = '\0';
in_addr = inet_addr(&ptr[1]);
/* code for systems without sophisticated networking */
/*
/* code for systems without sophisticated networking */
/*
-static char sccsid[] = "@(#)deliver.c 5.65 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 5.66 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
for (mvp = m->m_argv; (p = *++mvp) != NULL; )
{
for (mvp = m->m_argv; (p = *++mvp) != NULL; )
{
- while ((p = index(p, '\001')) != NULL)
+ while ((p = strchr(p, '\001')) != NULL)
if (*++p == 'u')
break;
if (p != NULL)
if (*++p == 'u')
break;
if (p != NULL)
# ifdef SMTP
clever = TRUE;
*pvp = NULL;
# ifdef SMTP
clever = TRUE;
*pvp = NULL;
/* oops! we don't implement SMTP */
syserr("SMTP style mailer");
return (EX_SOFTWARE);
/* oops! we don't implement SMTP */
syserr("SMTP style mailer");
return (EX_SOFTWARE);
(void) fflush(stdout);
# ifdef SIGCHLD
(void) signal(SIGCHLD, SIG_DFL);
(void) fflush(stdout);
# ifdef SIGCHLD
(void) signal(SIGCHLD, SIG_DFL);
DOFORK(FORK);
/* pid is set by DOFORK */
if (pid < 0)
DOFORK(FORK);
/* pid is set by DOFORK */
if (pid < 0)
extern char SmtpError[];
statmsg = SmtpError;
extern char SmtpError[];
statmsg = SmtpError;
}
}
if (statmsg != NULL && statmsg[0] != '\0')
}
}
if (statmsg != NULL && statmsg[0] != '\0')
# ifdef LOG
syslog(LOG_INFO, "%s: to=%s, delay=%s, stat=%s", e->e_id,
e->e_to, pintvl(curtime() - e->e_ctime, TRUE), stat);
# ifdef LOG
syslog(LOG_INFO, "%s: to=%s, delay=%s, stat=%s", e->e_id,
e->e_to, pintvl(curtime() - e->e_ctime, TRUE), stat);
}
\f/*
** PUTFROMLINE -- output a UNIX-style from line (or whatever)
}
\f/*
** PUTFROMLINE -- output a UNIX-style from line (or whatever)
char xbuf[MAXLINE];
expand("\001<", buf, &buf[sizeof buf - 1], e);
char xbuf[MAXLINE];
expand("\001<", buf, &buf[sizeof buf - 1], e);
- bang = index(buf, '!');
+ bang = strchr(buf, '!');
if (bang == NULL)
syserr("No ! in UUCP! (%s)", buf);
else
if (bang == NULL)
syserr("No ! in UUCP! (%s)", buf);
else
expand(template, buf, &buf[sizeof buf - 1], e);
putline(buf, fp, m);
}
expand(template, buf, &buf[sizeof buf - 1], e);
putline(buf, fp, m);
}
(mode != SM_VERIFY && SuperSafe)) &&
!bitset(EF_INQUEUE, e->e_flags))
queueup(e, TRUE, mode == SM_QUEUE);
(mode != SM_VERIFY && SuperSafe)) &&
!bitset(EF_INQUEUE, e->e_flags))
queueup(e, TRUE, mode == SM_QUEUE);
oldverbose = Verbose;
switch (mode)
oldverbose = Verbose;
switch (mode)
-static char sccsid[] = "@(#)envelope.c 5.31 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 5.32 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
e->e_id == NULL ? "(none)" : e->e_id,
e->e_flags, getpid());
syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
e->e_id == NULL ? "(none)" : e->e_id,
e->e_flags, getpid());
/* we must have an id to remove disk files */
if (e->e_id == NULL)
/* we must have an id to remove disk files */
if (e->e_id == NULL)
{
#ifdef QUEUE
queueup(e, FALSE, FALSE);
{
#ifdef QUEUE
queueup(e, FALSE, FALSE);
syserr("dropenvelope: queueup");
syserr("dropenvelope: queueup");
}
/* now unlock the job */
}
/* now unlock the job */
#ifdef TTYNAME
static char ybuf[10]; /* holds tty id */
register char *p;
#ifdef TTYNAME
static char ybuf[10]; /* holds tty id */
register char *p;
extern char *ttyname();
extern char *macvalue();
extern char Version[];
extern char *ttyname();
extern char *macvalue();
extern char Version[];
p = ttyname(2);
if (p != NULL)
{
p = ttyname(2);
if (p != NULL)
{
- if (rindex(p, '/') != NULL)
- p = rindex(p, '/') + 1;
+ if (strrchr(p, '/') != NULL)
+ p = strrchr(p, '/') + 1;
(void) strcpy(ybuf, p);
define('y', ybuf, e);
}
}
(void) strcpy(ybuf, p);
define('y', ybuf, e);
}
}
}
\f/*
** SETTIME -- set the current time.
}
\f/*
** SETTIME -- set the current time.
tm->tm_mday, tm->tm_hour, tm->tm_min);
define('t', tbuf, e);
(void) strcpy(dbuf, ctime(&now));
tm->tm_mday, tm->tm_hour, tm->tm_min);
define('t', tbuf, e);
(void) strcpy(dbuf, ctime(&now));
- *index(dbuf, '\n') = '\0';
+ *strchr(dbuf, '\n') = '\0';
if (macvalue('d', e) == NULL)
define('d', dbuf, e);
p = newstr(arpadate(dbuf));
if (macvalue('d', e) == NULL)
define('d', dbuf, e);
p = newstr(arpadate(dbuf));
# ifdef LOG
if (LogLevel > 19)
syslog(LOG_DEBUG, "%s: openx%s", e->e_id, e->e_xfp == NULL ? "" : " (no)");
# ifdef LOG
if (LogLevel > 19)
syslog(LOG_DEBUG, "%s: openx%s", e->e_id, e->e_xfp == NULL ? "" : " (no)");
if (e->e_xfp != NULL)
return;
p = queuename(e, 'x');
if (e->e_xfp != NULL)
return;
p = queuename(e, 'x');
extern bool trusteduser();
if (!trusteduser(realname) && getuid() != geteuid() &&
extern bool trusteduser();
if (!trusteduser(realname) && getuid() != geteuid() &&
- index(from, '!') == NULL && getuid() != 0)
+ strchr(from, '!') == NULL && getuid() != 0)
{
/* network sends -r regardless (why why why?) */
/* syserr("%s, you cannot use the -f flag", realname); */
{
/* network sends -r regardless (why why why?) */
/* syserr("%s, you cannot use the -f flag", realname); */
"from=%s unparseable, received from %s@%s",
from, realname, host);
}
"from=%s unparseable, received from %s@%s",
from, realname, host);
}
from = newstr(realname);
if (parseaddr(from, &e->e_from, 1, '\0', e) == NULL &&
parseaddr("postmaster", &e->e_from, 1, '\0', e) == NULL)
from = newstr(realname);
if (parseaddr(from, &e->e_from, 1, '\0', e) == NULL &&
parseaddr("postmaster", &e->e_from, 1, '\0', e) == NULL)
-static char sccsid[] = "@(#)err.c 5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c 5.15 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
syslog(LOG_CRIT, "%s: SYSERR: %s",
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
&MsgBuf[4]);
syslog(LOG_CRIT, "%s: SYSERR: %s",
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
&MsgBuf[4]);
errno = 0;
if (QuickAbort)
longjmp(TopFrame, 2);
errno = 0;
if (QuickAbort)
longjmp(TopFrame, 2);
syslog(LOG_NOTICE, "%s: %s",
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
&MsgBuf[4]);
syslog(LOG_NOTICE, "%s: %s",
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
&MsgBuf[4]);
if (QuickAbort)
longjmp(TopFrame, 1);
if (QuickAbort)
longjmp(TopFrame, 1);
static char buf[100];
# ifdef SMTP
extern char *SmtpPhase;
static char buf[100];
# ifdef SMTP
extern char *SmtpPhase;
# ifdef DAEMON
# ifdef ETIMEDOUT
# ifdef DAEMON
# ifdef ETIMEDOUT
-static char sccsid[] = "@(#)headers.c 5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c 5.25 (Berkeley) %G%";
#endif /* not lint */
# include <sys/param.h>
#endif /* not lint */
# include <sys/param.h>
if (def && *p == '?')
{
/* have some */
if (def && *p == '?')
{
/* have some */
- register char *q = index(p + 1, *p);
+ register char *q = strchr(p + 1, *p);
/* find canonical name */
fname = p;
/* find canonical name */
fname = p;
if (p == NULL)
{
syserr("chompheader: syntax error, line \"%s\"", line);
if (p == NULL)
{
syserr("chompheader: syntax error, line \"%s\"", line);
/* hack to see if this is a new format message */
if (!def && bitset(H_RCPT|H_FROM, h->h_flags) &&
/* hack to see if this is a new format message */
if (!def && bitset(H_RCPT|H_FROM, h->h_flags) &&
- (index(fvalue, ',') != NULL || index(fvalue, '(') != NULL ||
- index(fvalue, '<') != NULL || index(fvalue, ';') != NULL))
+ (strchr(fvalue, ',') != NULL || strchr(fvalue, '(') != NULL ||
+ strchr(fvalue, '<') != NULL || strchr(fvalue, ';') != NULL))
{
e->e_flags &= ~EF_OLDSTYLE;
}
{
e->e_flags &= ~EF_OLDSTYLE;
}
}
syslog(LOG_INFO, "%s: message-id=%s", e->e_id, p);
}
}
syslog(LOG_INFO, "%s: message-id=%s", e->e_id, p);
}
}
if (tTd(32, 1))
printf("----------------------------\n");
}
if (tTd(32, 1))
printf("----------------------------\n");
e->e_id, e->e_from.q_paddr, e->e_msgsize,
e->e_class, name);
}
e->e_id, e->e_from.q_paddr, e->e_msgsize,
e->e_class, name);
}
}
\f/*
** PRIENCODE -- encode external priority names into internal values.
}
\f/*
** PRIENCODE -- encode external priority names into internal values.
/* check for characters that may have to be quoted */
/* check for characters that may have to be quoted */
- if (index(".'@,;:[]", c) != NULL)
+ if (strchr(".'@,;:[]", c) != NULL)
{
/*
** If these occur as the phrase part of a <>
{
/*
** If these occur as the phrase part of a <>
register char *nlp;
(void) sprintf(obuf, "%s: ", capitalize(h->h_field));
register char *nlp;
(void) sprintf(obuf, "%s: ", capitalize(h->h_field));
- while ((nlp = index(p, '\n')) != NULL)
+ while ((nlp = strchr(p, '\n')) != NULL)
{
*nlp = '\0';
(void) strcat(obuf, p);
{
*nlp = '\0';
(void) strcat(obuf, p);
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 5.58 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.59 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
# ifdef SETPROCTITLE
char **Argv = NULL; /* pointer to argument vector */
char *LastArgv = NULL; /* end of argv */
# ifdef SETPROCTITLE
char **Argv = NULL; /* pointer to argument vector */
char *LastArgv = NULL; /* end of argv */
+# endif /* SETPROCTITLE */
/*
** The file in which to log raw recipient information.
/*
** The file in which to log raw recipient information.
#ifdef DAEMON
#ifndef SMTP
ERROR %%%% Cannot have daemon mode without SMTP %%%% ERROR
#ifdef DAEMON
#ifndef SMTP
ERROR %%%% Cannot have daemon mode without SMTP %%%% ERROR
-#endif SMTP
-#endif DAEMON
+#endif /* SMTP */
+#endif /* DAEMON */
#define MAXCONFIGLEVEL 3 /* highest config version level known */
#define MAXCONFIGLEVEL 3 /* highest config version level known */
LastArgv = envp[i - 1] + strlen(envp[i - 1]);
else
LastArgv = argv[argc - 1] + strlen(argv[argc - 1]);
LastArgv = envp[i - 1] + strlen(envp[i - 1]);
else
LastArgv = argv[argc - 1] + strlen(argv[argc - 1]);
+# endif /* SETPROCTITLE */
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
(void) signal(SIGINT, intsig);
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
(void) signal(SIGINT, intsig);
if (p++ == NULL)
p = *av;
if (strcmp(p, "newaliases") == 0)
if (p++ == NULL)
p = *av;
if (strcmp(p, "newaliases") == 0)
usrerr("Daemon mode not implemented");
ExitStat = EX_USAGE;
break;
usrerr("Daemon mode not implemented");
ExitStat = EX_USAGE;
break;
case MD_SMTP:
# ifndef SMTP
usrerr("I don't speak SMTP");
ExitStat = EX_USAGE;
break;
case MD_SMTP:
# ifndef SMTP
usrerr("I don't speak SMTP");
ExitStat = EX_USAGE;
break;
case MD_DELIVER:
case MD_VERIFY:
case MD_TEST:
case MD_DELIVER:
case MD_VERIFY:
case MD_TEST:
FullName = NULL;
queuemode = TRUE;
QueueIntvl = convtime(&p[2]);
FullName = NULL;
queuemode = TRUE;
QueueIntvl = convtime(&p[2]);
usrerr("I don't know about queues");
ExitStat = EX_USAGE;
usrerr("I don't know about queues");
ExitStat = EX_USAGE;
break;
case 't': /* read recipients from message */
break;
case 't': /* read recipients from message */
dropenvelope(CurEnv);
printqueue();
exit(EX_OK);
dropenvelope(CurEnv);
printqueue();
exit(EX_OK);
usrerr("No queue to print");
finis();
usrerr("No queue to print");
finis();
case MD_INITALIAS:
/* initialize alias database */
case MD_INITALIAS:
/* initialize alias database */
runqueue(FALSE);
finis();
}
runqueue(FALSE);
finis();
}
/*
** If a daemon, wait for a request.
/*
** If a daemon, wait for a request.
dropenvelope(CurEnv);
#ifdef DAEMON
dropenvelope(CurEnv);
#ifdef DAEMON
OpMode = MD_SMTP;
(void) newenvelope(CurEnv);
openxscript(CurEnv);
OpMode = MD_SMTP;
(void) newenvelope(CurEnv);
openxscript(CurEnv);
if (OpMode == MD_SMTP)
smtp(CurEnv);
if (OpMode == MD_SMTP)
smtp(CurEnv);
/*
** Do basic system initialization and set the sender
/*
** Do basic system initialization and set the sender
# ifdef LOG
if (LogLevel > 11)
syslog(LOG_DEBUG, "finis, pid=%d", getpid());
# ifdef LOG
if (LogLevel > 11)
syslog(LOG_DEBUG, "finis, pid=%d", getpid());
if (ExitStat == EX_TEMPFAIL)
ExitStat = EX_OK;
exit(ExitStat);
if (ExitStat == EX_TEMPFAIL)
ExitStat = EX_OK;
exit(ExitStat);
# ifdef LOG
if (LogLevel > 11)
syslog(LOG_DEBUG, "in background, pid=%d", getpid());
# ifdef LOG
if (LogLevel > 11)
syslog(LOG_DEBUG, "in background, pid=%d", getpid());
-static char sccsid[] = "@(#)parseaddr.c 5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c 5.25 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
return (ATM);
if (isspace(c) || c == ')')
return (SPC);
return (ATM);
if (isspace(c) || c == ')')
return (SPC);
- if (iscntrl(c) || index(buf, c) != NULL)
+ if (iscntrl(c) || strchr(buf, c) != NULL)
return (OPR);
return (ATM);
}
return (OPR);
return (ATM);
}
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 5.49 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 5.50 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 5.49 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 5.50 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
/* save log info */
if (LogLevel > 15)
syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
/* save log info */
if (LogLevel > 15)
syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
/* parent -- pick up intermediate zombie */
#ifndef SIGCHLD
(void) waitfor(pid);
/* parent -- pick up intermediate zombie */
#ifndef SIGCHLD
(void) waitfor(pid);
(void) signal(SIGCHLD, reapchild);
(void) signal(SIGCHLD, reapchild);
if (QueueIntvl != 0)
(void) setevent(QueueIntvl, runqueue, TRUE);
return;
if (QueueIntvl != 0)
(void) setevent(QueueIntvl, runqueue, TRUE);
return;
#ifndef SIGCHLD
if (fork() != 0)
exit(EX_OK);
#ifndef SIGCHLD
if (fork() != 0)
exit(EX_OK);
(void) signal(SIGCHLD, SIG_DFL);
(void) signal(SIGCHLD, SIG_DFL);
}
setproctitle("running queue: %s", QueueDir);
}
setproctitle("running queue: %s", QueueDir);
if (LogLevel > 11)
syslog(LOG_DEBUG, "runqueue %s, pid=%d, forkflag=%d",
QueueDir, getpid(), forkflag);
if (LogLevel > 11)
syslog(LOG_DEBUG, "runqueue %s, pid=%d, forkflag=%d",
QueueDir, getpid(), forkflag);
/*
** Release any resources used by the daemon code.
/*
** Release any resources used by the daemon code.
# ifdef DAEMON
clrdaemon();
# ifdef DAEMON
clrdaemon();
/*
** Create ourselves an envelope
/*
** Create ourselves an envelope
if (LogLevel > 12)
syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
getpid());
if (LogLevel > 12)
syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
getpid());
/* don't use the headers from sendmail.cf... */
e->e_header = NULL;
/* don't use the headers from sendmail.cf... */
e->e_header = NULL;
syslog(LOG_ALERT, "%s: bogus queue file, uid=%d, mode=%o",
e->e_id, st.st_uid, st.st_mode);
}
syslog(LOG_ALERT, "%s: bogus queue file, uid=%d, mode=%o",
e->e_id, st.st_uid, st.st_mode);
}
fclose(qfp);
return FALSE;
}
fclose(qfp);
return FALSE;
}
# ifdef LOG
if (LogLevel > 10)
syslog(LOG_DEBUG, "%s: locked", e->e_id);
# ifdef LOG
if (LogLevel > 10)
syslog(LOG_DEBUG, "%s: locked", e->e_id);
(void) fclose(qfp);
return FALSE;
}
(void) fclose(qfp);
return FALSE;
}
\f/*
** QUEUENAME -- build a file name in the queue directory for this envelope.
**
\f/*
** QUEUENAME -- build a file name in the queue directory for this envelope.
**
# ifdef LOG
if (LogLevel > 16)
syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
# ifdef LOG
if (LogLevel > 16)
syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
# ifdef LOG
if (LogLevel > 19)
syslog(LOG_DEBUG, "%s: unlock", e->e_id);
# ifdef LOG
if (LogLevel > 19)
syslog(LOG_DEBUG, "%s: unlock", e->e_id);
if (!tTd(51, 4))
xunlink(queuename(e, 'x'));
if (!tTd(51, 4))
xunlink(queuename(e, 'x'));
-static char sccsid[] = "@(#)readcf.c 5.47 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c 5.48 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
/* delete preceeding white space */
while (isspace(*p) && p > buf)
p--;
/* delete preceeding white space */
while (isspace(*p) && p > buf)
p--;
- if ((e = index(++p, '\n')) != NULL)
+ if ((e = strchr(++p, '\n')) != NULL)
(void) strcpy(p, e);
else
p[0] = p[1] = '\0';
(void) strcpy(p, e);
else
p[0] = p[1] = '\0';
if (sscanf(buf, fmt, wordbuf) != 1)
continue;
p = wordbuf;
if (sscanf(buf, fmt, wordbuf) != 1)
continue;
p = wordbuf;
/*
** Break up the match into words.
/*
** Break up the match into words.
case SM_QUEUE: /* queue only */
#ifndef QUEUE
syserr("need QUEUE to set -odqueue");
case SM_QUEUE: /* queue only */
#ifndef QUEUE
syserr("need QUEUE to set -odqueue");
/* fall through..... */
case SM_DELIVER: /* do everything */
/* fall through..... */
case SM_DELIVER: /* do everything */
-static char sccsid[] = "@(#)recipient.c 5.36 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 5.37 (Berkeley) %G%";
#endif /* not lint */
# include <sys/types.h>
#endif /* not lint */
# include <sys/types.h>
/* heuristic to determine old versus new style addresses */
if (ctladdr == NULL &&
/* heuristic to determine old versus new style addresses */
if (ctladdr == NULL &&
- (index(list, ',') != NULL || index(list, ';') != NULL ||
- index(list, '<') != NULL || index(list, '(') != NULL))
+ (strchr(list, ',') != NULL || strchr(list, ';') != NULL ||
+ strchr(list, '<') != NULL || strchr(list, '(') != NULL))
e->e_flags &= ~EF_OLDSTYLE;
delimiter = ' ';
if (!bitset(EF_OLDSTYLE, e->e_flags) || ctladdr != NULL)
e->e_flags &= ~EF_OLDSTYLE;
delimiter = ' ';
if (!bitset(EF_OLDSTYLE, e->e_flags) || ctladdr != NULL)
struct stat stb;
extern bool writable();
struct stat stb;
extern bool writable();
/* check if writable or creatable */
if (a->q_alias == NULL && !QueueRun && !ForceMail)
{
/* check if writable or creatable */
if (a->q_alias == NULL && !QueueRun && !ForceMail)
{
char buf[MAXNAME];
fullname(pw, buf);
char buf[MAXNAME];
fullname(pw, buf);
- if (index(buf, ' ') != NULL && !strcasecmp(buf, name))
+ if (strchr(buf, ' ') != NULL && !strcasecmp(buf, name))
{
if (tTd(29, 4))
printf("fuzzy matches %s\n", pw->pw_name);
{
if (tTd(29, 4))
printf("fuzzy matches %s\n", pw->pw_name);
LineNumber = 0;
while (fgets(buf, sizeof buf, fp) != NULL)
{
LineNumber = 0;
while (fgets(buf, sizeof buf, fp) != NULL)
{
- register char *p = index(buf, '\n');
+ register char *p = strchr(buf, '\n');
LineNumber++;
if (p != NULL)
LineNumber++;
if (p != NULL)
-static char sccsid[] = "@(#)savemail.c 5.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 5.21 (Berkeley) %G%";
#endif /* not lint */
# include <sys/types.h>
#endif /* not lint */
# include <sys/types.h>
# ifdef LOG
if (LogLevel >= 1)
syslog(LOG_ALERT, "savemail: HELP!!!!");
# ifdef LOG
if (LogLevel >= 1)
syslog(LOG_ALERT, "savemail: HELP!!!!");
/* leave the locked queue & transcript files around */
exit(EX_SOFTWARE);
/* leave the locked queue & transcript files around */
exit(EX_SOFTWARE);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)sendmail.h 5.39 (Berkeley) %G%
+ * @(#)sendmail.h 5.40 (Berkeley) %G%
# ifdef _DEFINE
# define EXTERN
# ifndef lint
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 5.39 %G%";
+static char SmailSccsId[] = "@(#)sendmail.h 5.40 %G%";
+# include <stddef.h>
+# include <stdlib.h>
# include <stdio.h>
# include <ctype.h>
# include <setjmp.h>
# include <sysexits.h>
# include <stdio.h>
# include <ctype.h>
# include <setjmp.h>
# include <sysexits.h>
+# include <string.h>
+# include <time.h>
+# include <errno.h>
+
# include "conf.h"
# include "conf.h"
# include "useful.h"
# ifdef LOG
# include <syslog.h>
# include "conf.h"
# include "conf.h"
# include "useful.h"
# ifdef LOG
# include <syslog.h>
# ifdef DAEMON
# include <sys/socket.h>
# include <netinet/in.h>
# ifdef DAEMON
# include <sys/socket.h>
# include <netinet/in.h>
# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
-static char sccsid[] = "@(#)srvrsmtp.c 5.38 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 5.39 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)srvrsmtp.c 5.38 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 5.39 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
if (p == NULL)
p = buf;
else
if (p == NULL)
p = buf;
else
#ifndef lint
#ifdef USERDB
#ifndef lint
#ifdef USERDB
-static char sccsid [] = "@(#)udb.c 5.19 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c 5.20 (Berkeley) %G% (with USERDB)";
-static char sccsid [] = "@(#)udb.c 5.19 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c 5.20 (Berkeley) %G% (without USERDB)";
if (*p == '\0')
break;
spec = p;
if (*p == '\0')
break;
spec = p;
if (p != NULL)
*p++ = '\0';
if (p != NULL)
*p++ = '\0';
register char *spec_end;
register int optnum;
register char *spec_end;
register int optnum;
- spec_end = index(udbspec, ':');
+ spec_end = strchr(udbspec, ':');
for (optnum = 0; optnum < maxopts && (spec = spec_end) != NULL; optnum++)
{
register char *p;
while (isspace(*spec))
spec++;
for (optnum = 0; optnum < maxopts && (spec = spec_end) != NULL; optnum++)
{
register char *p;
while (isspace(*spec))
spec++;
- spec_end = index(spec, ':');
+ spec_end = strchr(spec, ':');
if (spec_end != NULL)
*spec_end++ = '\0';
opt[optnum].name = spec;
opt[optnum].val = NULL;
if (spec_end != NULL)
*spec_end++ = '\0';
opt[optnum].name = spec;
opt[optnum].val = NULL;
if (p != NULL)
opt[optnum].val = ++p;
}
if (p != NULL)
opt[optnum].val = ++p;
}
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)useful.h 4.6 (Berkeley) %G%
+ * @(#)useful.h 4.7 (Berkeley) %G%
*/
# include <sys/types.h>
*/
# include <sys/types.h>
# ifndef NULL
# define NULL 0
# ifndef NULL
# define NULL 0
/* bit hacking */
# define bitset(bit, word) (((word) & (bit)) != 0)
/* bit hacking */
# define bitset(bit, word) (((word) & (bit)) != 0)
fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\
fprintf(stderr, msg, parm);\
}
fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\
fprintf(stderr, msg, parm);\
}
# define ASSERT(expr, msg, parm)
# define ASSERT(expr, msg, parm)
/* sccs id's */
# ifndef lint
# define SCCSID(arg) static char SccsId[] = "arg";
/* sccs id's */
# ifndef lint
# define SCCSID(arg) static char SccsId[] = "arg";
# define SCCSID(arg)
# endif lint
# define SCCSID(arg)
# endif lint
-
-/* define the types of some common functions */
-extern char *strcpy(), *strncpy();
-extern char *strcat(), *strncat();
-extern char *malloc();
-extern char *index(), *rindex();
-extern int errno;
-extern time_t time();
-extern char *ctime();
-extern char *getenv();
-static char sccsid[] = "@(#)usersmtp.c 5.23 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 5.24 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)usersmtp.c 5.23 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 5.24 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
if (errno == 0)
# ifdef ECONNRESET
errno = ECONNRESET;
if (errno == 0)
# ifdef ECONNRESET
errno = ECONNRESET;
+# endif /* ECONNRESET */
message(Arpa_TSyserr, "reply: read error");
/* if debugging, pause so we can see state */
message(Arpa_TSyserr, "reply: read error");
/* if debugging, pause so we can see state */
pause();
# ifdef LOG
syslog(LOG_INFO, "%s", &MsgBuf[4]);
pause();
# ifdef LOG
syslog(LOG_INFO, "%s", &MsgBuf[4]);
mci->mci_state = MCIS_ERROR;
smtpquit(m, mci, e);
return (-1);
}
fixcrlf(SmtpReplyBuffer, TRUE);
mci->mci_state = MCIS_ERROR;
smtpquit(m, mci, e);
return (-1);
}
fixcrlf(SmtpReplyBuffer, TRUE);
- if (e->e_xfp != NULL && index("45", SmtpReplyBuffer[0]) != NULL)
+ if (e->e_xfp != NULL && strchr("45", SmtpReplyBuffer[0]) != NULL)
{
/* serious error -- log the previous command */
if (SmtpMsgBuffer[0] != '\0')
{
/* serious error -- log the previous command */
if (SmtpMsgBuffer[0] != '\0')
m == NULL ? "\r\n" : m->m_eol);
}
m == NULL ? "\r\n" : m->m_eol);
}
-static char sccsid[] = "@(#)util.c 5.31 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c 5.32 (Berkeley) %G%";
#endif /* not lint */
# include <stdio.h>
#endif /* not lint */
# include <stdio.h>
register int sz;
{
register char *p;
register int sz;
{
register char *p;
p = malloc((unsigned) sz);
if (p == NULL)
p = malloc((unsigned) sz);
if (p == NULL)
+ p = strchr(line, '\n');
if (p == NULL)
return;
if (p > line && p[-1] == '\r')
if (p == NULL)
return;
if (p > line && p[-1] == '\r')
do
{
/* find the end of the line */
do
{
/* find the end of the line */
if (p == NULL)
p = &l[strlen(l)];
if (p == NULL)
p = &l[strlen(l)];
# ifdef LOG
if (LogLevel > 20)
syslog(LOG_DEBUG, "%s: unlink %s\n", CurEnv->e_id, f);
# ifdef LOG
if (LogLevel > 20)
syslog(LOG_DEBUG, "%s: unlink %s\n", CurEnv->e_id, f);
i = unlink(f);
# ifdef LOG
if (i < 0 && LogLevel > 21)
syslog(LOG_DEBUG, "%s: unlink-fail %d", f, errno);
i = unlink(f);
# ifdef LOG
if (i < 0 && LogLevel > 21)
syslog(LOG_DEBUG, "%s: unlink-fail %d", f, errno);
}
\f/*
** SFGETS -- "safe" fgets -- times out and ignores random interrupts.
}
\f/*
** SFGETS -- "safe" fgets -- times out and ignores random interrupts.
atobool(s)
register char *s;
{
atobool(s)
register char *s;
{
- if (*s == '\0' || index("tTyY", *s) != NULL)
+ if (*s == '\0' || strchr("tTyY", *s) != NULL)
return (TRUE);
return (FALSE);
}
return (TRUE);
return (FALSE);
}
-static char sccsid[] = "@(#)version.c 5.122 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c 5.123 (Berkeley) %G%";
-char Version[] = "5.122";
+char Version[] = "5.123";