diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2002-06-26 02:48:44 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2002-06-26 02:48:44 +0000 |
commit | fc4e7b69e3f764d3a1d9157868bc6965ef1db7d6 (patch) | |
tree | b35f716ab0dae216026e8ad27c85a951ee743a03 /contrib/sendmail/src/main.c | |
parent | faacdfb2c2946459651449cedf08a1bc29aee731 (diff) | |
download | FreeBSD-src-fc4e7b69e3f764d3a1d9157868bc6965ef1db7d6.zip FreeBSD-src-fc4e7b69e3f764d3a1d9157868bc6965ef1db7d6.tar.gz |
Import sendmail 8.12.5
Diffstat (limited to 'contrib/sendmail/src/main.c')
-rw-r--r-- | contrib/sendmail/src/main.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c index 78c1862..22a1aac 100644 --- a/contrib/sendmail/src/main.c +++ b/contrib/sendmail/src/main.c @@ -25,7 +25,7 @@ SM_UNUSED(static char copyright[]) = The Regents of the University of California. All rights reserved.\n"; #endif /* ! lint */ -SM_RCSID("@(#)$Id: main.c,v 8.882 2002/05/10 16:20:55 ca Exp $") +SM_RCSID("@(#)$Id: main.c,v 8.887 2002/06/17 22:25:52 gshapiro Exp $") #if NETINET || NETINET6 @@ -1064,6 +1064,11 @@ main(argc, argv, envp) default: i = Errors; QueueIntvl = convtime(optarg, 'm'); + if (QueueIntvl < 0) + { + usrerr("Invalid -q value"); + ExitStat = EX_USAGE; + } /* check for bad conversion */ if (i < Errors) @@ -1188,14 +1193,19 @@ main(argc, argv, envp) if (bitset(SUBMIT_MTA, SubmitMode)) { - macdefine(&BlankEnvelope.e_macro, A_PERM, - macid("{daemon_flags}"), "CC f"); + /* If set daemon_flags on command line, don't reset it */ + if (macvalue(macid("{daemon_flags}"), &BlankEnvelope) == NULL) + macdefine(&BlankEnvelope.e_macro, A_PERM, + macid("{daemon_flags}"), "CC f"); } else if (OpMode == MD_DELIVER || OpMode == MD_SMTP) { SubmitMode = SUBMIT_MSA; - macdefine(&BlankEnvelope.e_macro, A_PERM, - macid("{daemon_flags}"), "c u"); + + /* If set daemon_flags on command line, don't reset it */ + if (macvalue(macid("{daemon_flags}"), &BlankEnvelope) == NULL) + macdefine(&BlankEnvelope.e_macro, A_PERM, + macid("{daemon_flags}"), "c u"); } /* @@ -2243,7 +2253,7 @@ main(argc, argv, envp) ** during startup. */ - if (OpMode == MD_DAEMON || QueueIntvl != 0) + if (OpMode == MD_DAEMON || QueueIntvl > 0) { char dtype[200]; @@ -2283,7 +2293,7 @@ main(argc, argv, envp) (void) sm_strlcat(dtype, "+SMTP", sizeof dtype); DaemonPid = CurrentPid; } - if (QueueIntvl != 0) + if (QueueIntvl > 0) { (void) sm_strlcat2(dtype, queuepersistent @@ -2314,7 +2324,7 @@ main(argc, argv, envp) (void) sm_releasesignal(SIGHUP); (void) sm_signal(SIGTERM, sigterm); - if (QueueIntvl != 0) + if (QueueIntvl > 0) { (void) runqueue(true, false, queuepersistent, true); |