summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@cvs.openbsd.org>2015-12-11 07:45:00 +0000
committerSunil Nimmagadda <sunil@cvs.openbsd.org>2015-12-11 07:45:00 +0000
commit2e3677fa88b802ad6b34bc72c53afc0f9db7cbaf (patch)
treec3de3c52ee80fbd57f99ef0e16f675590b957ae3 /usr.sbin/smtpd
parente3cd0042444937e889df8824d826544484d40e05 (diff)
New '-F' option to let smtpd run in foreground while logging to
syslog. Ok gilles@ jung@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/smtpd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index ab7e8f96f2b..635918786d6 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.261 2015/12/10 14:07:04 sunil Exp $ */
+/* $OpenBSD: smtpd.c,v 1.262 2015/12/11 07:44:59 sunil Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -132,6 +132,7 @@ int profiling = 0;
int verbose = 0;
int debug = 0;
int foreground = 0;
+int foreground_log = 0;
int control_socket = -1;
struct tree children;
@@ -457,7 +458,7 @@ main(int argc, char *argv[])
TAILQ_INIT(&offline_q);
- while ((c = getopt(argc, argv, "B:dD:hnP:f:T:v")) != -1) {
+ while ((c = getopt(argc, argv, "B:dD:hnP:f:FT:v")) != -1) {
switch (c) {
case 'B':
if (strstr(optarg, "queue=") == optarg)
@@ -473,6 +474,7 @@ main(int argc, char *argv[])
break;
case 'd':
foreground = 1;
+ foreground_log = 1;
break;
case 'D':
if (cmdline_symset(optarg) < 0)
@@ -491,6 +493,10 @@ main(int argc, char *argv[])
case 'f':
conffile = optarg;
break;
+ case 'F':
+ foreground = 1;
+ break;
+
case 'T':
if (!strcmp(optarg, "imsg"))
verbose |= TRACE_IMSG;
@@ -625,7 +631,7 @@ main(int argc, char *argv[])
if (env->sc_queue_flags & QUEUE_COMPRESSION)
env->sc_comp = compress_backend_lookup("gzip");
- log_init(foreground);
+ log_init(foreground_log);
log_verbose(verbose);
load_pki_tree();