(usually root) to own the delivery process
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.45
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 8.27
SCCS-vsn: usr.sbin/sendmail/src/err.c 8.19
SCCS-vsn: usr.sbin/sendmail/src/collect.c 8.8
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.30
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.61
-static char sccsid[] = "@(#)collect.c 8.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)collect.c 8.8 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
break;
/* check for transparent dot */
break;
/* check for transparent dot */
- if (OpMode == MD_SMTP && bp[0] == '.' && bp[1] == '.')
+ if ((OpMode == MD_SMTP || OpMode == MD_DAEMON) &&
+ bp[0] == '.' && bp[1] == '.')
}
/* An EOF when running SMTP is an error */
}
/* An EOF when running SMTP is an error */
- if (inputerr && OpMode == MD_SMTP)
+ if (inputerr && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
{
char *host;
char *problem;
{
char *host;
char *problem;
#ifndef lint
#ifdef DAEMON
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.29 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.30 (Berkeley) %G% (with daemon mode)";
-static char sccsid[] = "@(#)daemon.c 8.29 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.30 (Berkeley) %G% (without daemon mode)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
-static char sccsid[] = "@(#)deliver.c 8.60 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 8.61 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
** addresses to be sent.
*/
** addresses to be sent.
*/
- if (bitset(EF_FATALERRS, e->e_flags) && OpMode == MD_SMTP)
+ if (bitset(EF_FATALERRS, e->e_flags) &&
+ (OpMode == MD_SMTP || OpMode == MD_DAEMON))
{
e->e_flags |= EF_CLRQUEUE;
return;
{
e->e_flags |= EF_CLRQUEUE;
return;
#ifdef NAMED_BIND
/* unless interactive, try twice, over a minute */
#ifdef NAMED_BIND
/* unless interactive, try twice, over a minute */
- if (OpMode == MD_DAEMON || OpMode == MD_SMTP) {
+ if (OpMode == MD_DAEMON || OpMode == MD_SMTP)
+ {
_res.retrans = 30;
_res.retry = 2;
}
_res.retrans = 30;
_res.retry = 2;
}
}
(void) close(rpvect[1]);
}
}
(void) close(rpvect[1]);
}
- else if (OpMode == MD_SMTP || HoldErrs)
+ else if (OpMode == MD_SMTP || OpMode == MD_DAEMON || HoldErrs)
{
/* put mailer output in transcript */
if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
{
/* put mailer output in transcript */
if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
-static char sccsid[] = "@(#)envelope.c 8.26 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 8.27 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
** Username can return errno != 0 on non-errors.
*/
** Username can return errno != 0 on non-errors.
*/
- if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP)
+ if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP ||
+ OpMode == MD_DAEMON)
realname = from;
if (realname == NULL || realname[0] == '\0')
realname = username();
realname = from;
if (realname == NULL || realname[0] == '\0')
realname = username();
if (FullName != NULL && !internal)
define('x', FullName, e);
}
if (FullName != NULL && !internal)
define('x', FullName, e);
}
+ else if (!internal && OpMode != MD_DAEMON)
{
if (e->e_from.q_home == NULL)
e->e_from.q_home = getenv("HOME");
{
if (e->e_from.q_home == NULL)
e->e_from.q_home = getenv("HOME");
-static char sccsid[] = "@(#)err.c 8.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c 8.19 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
msg[0] = '5';
(void) fflush(stdout);
msg[0] = '5';
(void) fflush(stdout);
+ if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
fprintf(OutChannel, "%s\r\n", msg);
else
fprintf(OutChannel, "%s\n", &msg[4]);
if (TrafficLogFile != NULL)
fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(),
fprintf(OutChannel, "%s\r\n", msg);
else
fprintf(OutChannel, "%s\n", &msg[4]);
if (TrafficLogFile != NULL)
fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(),
- OpMode == MD_SMTP ? msg : &msg[4]);
+ (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]);
if (msg[3] == ' ')
(void) fflush(OutChannel);
if (!ferror(OutChannel))
if (msg[3] == ' ')
(void) fflush(OutChannel);
if (!ferror(OutChannel))
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.44 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 8.45 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
** commands. This will never return.
*/
** commands. This will never return.
*/
+ if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
smtp(CurEnv);
# endif /* SMTP */
smtp(CurEnv);
# endif /* SMTP */