Added basic tests to verify the output formats for original
and JSON output. Files: postmulti/postmulti.c,
postmulti/fake_strcmp.c, postmulti/Makefile.in.
+
+20251125
+
+ Cleanup: too many braces in postmulti JSON output. Files:
+ postmulti/Makefile.in, postmulti/postmulti.c.
<b>List mode</b>
<b>-j</b> Produce JSON output. See JSON OBJECT FORMAT below.
+ This feature is available in Postfix version 3.11 and later.
+
<b>-l</b> List Postfix instances with their instance name, instance group
name, enable/disable status and configuration directory.
.fi
.IP \fB\-j\fR
Produce JSON output. See JSON OBJECT FORMAT below.
+
+This feature is available in Postfix version 3.11 and later.
.IP \fB\-l\fR
List Postfix instances with their instance name, instance
group name, enable/disable status and configuration directory.
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20251124"
+#define MAIL_RELEASE_DATE "20251125"
#define MAIL_VERSION_NUMBER "3.11"
#ifdef SNAPSHOT
echo daemon_directory = ../../libexec >> main.cf
echo meta_directory = . >> main.cf
echo shlib_directory = ../../lib >> main.cf
- echo "{{\"name\": \"-\"},{\"group\": \"-\"},{\"enabled\": \"y\"},{\"config_directory\": \".\"}}" >> json_single_test.tmp
+ echo "{\"name\": \"-\",\"group\": \"-\",\"enabled\": \"y\",\"config_directory\": \".\"}" >> json_single_test.tmp
$(SHLIB_ENV) ${VALGRIND} LD_PRELOAD=./fake_strcmp.so MAIL_CONFIG=. \
./$(PROG) -lj | diff json_single_test.tmp -
rm -f main.cf json_single_test.tmp
/* .fi
/* .IP \fB-j\fR
/* Produce JSON output. See JSON OBJECT FORMAT below.
+/*
+/* This feature is available in Postfix version 3.11 and later.
/* .IP \fB-l\fR
/* List Postfix instances with their instance name, instance
/* group name, enable/disable status and configuration directory.
ip->enabled ? "y" : "n",
ip->config_dir);
} else {
- vstream_printf("{{\"name\": \"%s\"},",
+ vstream_printf("{\"name\": \"%s\",",
quote_for_json(json_buf,
ip->name ? ip->name : "-", -1));
- vstream_printf("{\"group\": \"%s\"},",
+ vstream_printf("\"group\": \"%s\",",
quote_for_json(json_buf,
ip->gname ? ip->gname : "-", 1));
- vstream_printf("{\"enabled\": \"%s\"},",
+ vstream_printf("\"enabled\": \"%s\",",
quote_for_json(json_buf,
ip->enabled ? "y" : "n", 1));
- vstream_printf("{\"config_directory\": \"%s\"}}\n",
+ vstream_printf("\"config_directory\": \"%s\"}\n",
quote_for_json(json_buf,
ip->config_dir, -1));
}