summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2016-03-10 23:48:48 +0100
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2016-03-11 00:19:56 +0100
commit3257ed4b66a48c2bbd3e558cce7990df937c7d21 (patch)
treedd9985ba65ae964aae3ea8eefad22150c3154f6d
parenta2a9afb4247c61efb68db222374530e12f4c35e8 (diff)
Honour the -n for -bP config
-rw-r--r--src/src/exim.c2
-rw-r--r--src/src/functions.h2
-rw-r--r--src/src/readconf.c13
-rw-r--r--test/scripts/0000-Basic/05723
-rw-r--r--test/stdout/057228
5 files changed, 40 insertions, 8 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 3b6a9ba69..9cafc9a73 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -4572,7 +4572,7 @@ if (list_options)
if (list_config)
{
set_process_info("listing config");
- readconf_print(US"config", NULL, FALSE);
+ readconf_print(US"config", NULL, flag_n);
exim_exit(EXIT_SUCCESS);
}
diff --git a/src/src/functions.h b/src/src/functions.h
index 53ed64345..a5278a620 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -313,7 +313,7 @@ extern void readconf_driver_init(uschar *, driver_instance **,
driver_info *, int, void *, int, optionlist *, int);
extern uschar *readconf_find_option(void *);
extern void readconf_main(void);
-extern void readconf_print(uschar *, uschar *, BOOL);
+extern void readconf_print(uschar *, uschar *, BOOL no_labels);
extern uschar *readconf_printtime(int);
extern uschar *readconf_readname(uschar *, int, uschar *);
extern int readconf_readtime(const uschar *, int, BOOL);
diff --git a/src/src/readconf.c b/src/src/readconf.c
index d0b8e0bcf..328d49558 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -16,7 +16,7 @@ extern char **environ;
static void fn_smtp_receive_timeout(const uschar * name, const uschar * str);
static void save_config_line(const uschar* line);
static void save_config_position(const uschar *file, int line);
-static void print_config(BOOL admin);
+static void print_config(BOOL admin, BOOL terse);
#define CSTATE_STACK_SIZE 10
@@ -2649,7 +2649,7 @@ if (type == NULL)
if (Ustrcmp(name, "config") == 0)
{
- print_config(admin_user);
+ print_config(admin_user, no_labels);
return;
}
@@ -4303,10 +4303,10 @@ current = next;
/* List the parsed config lines, care about nice formatting and
hide the <hide> values unless we're the admin user */
void
-print_config(BOOL admin)
+print_config(BOOL admin, BOOL terse)
{
config_line_item *i;
-const int TS = 2;
+const int TS = terse ? 0 : 2;
int indent = 0;
for (i = config_lines; i; i = i->next)
@@ -4346,7 +4346,7 @@ for (i = config_lines; i; i = i->next)
/* begin lines are left aligned */
else if (Ustrncmp(current, "begin", 5) == 0 && isspace(current[5]))
{
- puts("");
+ if (!terse) puts("");
puts(CCS current);
indent = TS;
}
@@ -4354,7 +4354,8 @@ for (i = config_lines; i; i = i->next)
/* router/acl/transport block names */
else if (current[Ustrlen(current)-1] == ':' && !Ustrchr(current, '='))
{
- printf("\n%*s%s\n", TS, "", current);
+ if (!terse) puts("");
+ printf("%*s%s\n", TS, "", current);
indent = 2 * TS;
}
diff --git a/test/scripts/0000-Basic/0572 b/test/scripts/0000-Basic/0572
index ae31ea027..2866a23f1 100644
--- a/test/scripts/0000-Basic/0572
+++ b/test/scripts/0000-Basic/0572
@@ -26,3 +26,6 @@ perl -e 'print "\n";'
#
exim -bP config
****
+#
+exim -n -bP config
+****
diff --git a/test/stdout/0572 b/test/stdout/0572
index 3a026977c..0c8d6e9b7 100644
--- a/test/stdout/0572
+++ b/test/stdout/0572
@@ -101,3 +101,31 @@ begin transports
interface = ip4.ip4.ip4.ip4
port = 1224
debug_print = transport_name <$transport_name>
+# Exim Configuration (X)
+# 1 "TESTSUITE/test-config"
+OPT =
+exim_path = TESTSUITE/eximdir/exim
+keep_environment =
+hide host_lookup_order = bydns
+primary_hostname = myhost.test.ex
+spool_directory = TESTSUITE/spool
+log_file_path = TESTSUITE/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+log_selector = +outgoing_port
+domainlist local_domains = test.ex : *.test.ex
+acl_smtp_rcpt = accept
+begin routers
+my_main_router:
+driver = manualroute
+route_list = * 127.0.0.1
+self = send
+transport = my_smtp
+hide debug_print = router_name <$router_name>
+no_more
+begin transports
+my_smtp:
+driver = smtp
+interface = ip4.ip4.ip4.ip4
+port = 1224
+debug_print = transport_name <$transport_name>