2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-29 21:27:57 +00:00

postfix-3.1-20160117

This commit is contained in:
Wietse Venema 2016-01-17 00:00:00 -05:00 committed by Viktor Dukhovni
parent adbd9510a1
commit 4ff3cc38f3
32 changed files with 442 additions and 110 deletions

View File

@ -22103,3 +22103,28 @@ Apologies for any names omitted.
with insecure MX records. Viktor Dukhovni. Files:
posttls-finger/posttls-finger.c, smtp/smtp_tls_policy.c,
tls/tls.h, tls/tls_client.c, tls/tls_level.c.
20160108
Cleanup: smtp_reply_footer() now restores state in case of
input error; unit tests that cover most if not all error
and non-error cases. Files: global/smtp_reply_footer.c,
global/smtp_reply_footer.ref.
20160110
Bitrot: const-ification for OpenSSL 1.1.0. Viktor Dukhovni.
File: tls/tls_misc.c.
20160116
"postconf -H" support (show names without the =value).
Initial use case: mass reversal of TLS-related main.cf
parameters (postconf -nH | grep _tls_ | xargs postconf -X).
This flag also works with "postconf -F" and "postconf -P".
Added missing documentation that -h works with "postconf
-F" and "postconf -P". Files: postconf.c, postconf.h,
postconf_master.c, postconf_main.c.
Robustness: force html2text to produce ASCII output. File:
mantools/html2readme.

View File

@ -13,7 +13,7 @@ DIRS = src/util src/global src/dns src/tls src/xsasl src/master src/milter \
src/posttls-finger
MANDIRS = proto man html
LIBEXEC = libexec/post-install libexec/postfix-script libexec/postfix-wrapper \
libexec/postmulti-script libexec/post-install
libexec/postmulti-script
PLUGINS = meta/dynamicmaps.cf
META = meta/main.cf.proto meta/master.cf.proto meta/postfix-files \
meta/makedefs.out $(PLUGINS)

View File

@ -12,7 +12,7 @@ POSTCONF(1) POSTCONF(1)
<b>SYNOPSIS</b>
<b>Managing <a href="postconf.5.html">main.cf</a>:</b>
<b>postconf</b> [<b>-dfhnopvx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-C</b> <i>class,...</i>] [<i>parameter ...</i>]
<b>postconf</b> [<b>-dfhHnopvx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-C</b> <i>class,...</i>] [<i>parameter ...</i>]
<b>postconf</b> [<b>-epv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] <i>parameter</i><b>=</b><i>value ...</i>
@ -32,13 +32,13 @@ POSTCONF(1) POSTCONF(1)
<b>Managing <a href="master.5.html">master.cf</a> service fields:</b>
<b>postconf -F</b> [<b>-fovx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service</i>[<b>/</b><i>type</i>[<b>/</b><i>field</i>]] <i>...</i>]
<b>postconf -F</b> [<b>-fhHovx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service</i>[<b>/</b><i>type</i>[<b>/</b><i>field</i>]] <i>...</i>]
<b>postconf -F</b> [<b>-ev</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] <i>service</i><b>/</b><i>type</i><b>/</b><i>field</i><b>=</b><i>value ...</i>
<b>Managing <a href="master.5.html">master.cf</a> service parameters:</b>
<b>postconf -P</b> [<b>-fovx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service</i>[<b>/</b><i>type</i>[<b>/</b><i>parameter</i>]] <i>...</i>]
<b>postconf -P</b> [<b>-fhHovx</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service</i>[<b>/</b><i>type</i>[<b>/</b><i>parameter</i>]] <i>...</i>]
<b>postconf -P</b> [<b>-ev</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] <i>service</i><b>/</b><i>type</i><b>/</b><i>parameter</i><b>=</b><i>value ...</i>
@ -176,6 +176,11 @@ POSTCONF(1) POSTCONF(1)
<b>-h</b> Show parameter or attribute values without the "<i>name</i> = " label
that normally precedes the value.
<b>-H</b> Show parameter or attribute names without the " = <i>value</i>" that
normally follows the name.
This feature is available with Postfix 3.1 and later.
<b>-l</b> List the names of all supported mailbox locking methods. Post-
fix supports the following methods:
@ -489,5 +494,10 @@ POSTCONF(1) POSTCONF(1)
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
POSTCONF(1)
</pre> </body> </html>

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title> Postfix manual - postlog(1) </title>
</head> <body> <pre>
POSTLOG(1) POSTLOG(1)
POSTLOG(1) General Commands Manual POSTLOG(1)
<b>NAME</b>
postlog - Postfix-compatible logging utility
@ -80,5 +80,10 @@ POSTLOG(1) POSTLOG(1)
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
POSTLOG(1)
</pre> </body> </html>

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title> Postfix manual - posttls-finger(1) </title>
</head> <body> <pre>
POSTTLS-FINGER(1) POSTTLS-FINGER(1)
POSTTLS-FINGER(1) General Commands Manual POSTTLS-FINGER(1)
<b>NAME</b>
posttls-finger - Probe the TLS properties of an ESMTP or LMTP server.
@ -287,7 +287,7 @@ POSTTLS-FINGER(1) POSTTLS-FINGER(1)
<b>[]</b>. If you want to connect to a specific MX host, for instance
<i>mx1.example.com</i>, specify [<i>mx1.example.com</i>] as the destination
and <i>example.com</i> as a <b>match</b> argument. When using DNS, the desti-
nation domain is assumed fully qualified and no <a href="ADDRESS_CLASS_README.html#default_domain_class">default domain</a>
nation domain is assumed fully qualified and no default domain
or search suffixes are applied; you must use fully-qualified
names or also enable <b>native</b> host lookups (these don't support
<b>dane</b> or <b>dane-only</b> as no DNSSEC validation information is avail-

View File

@ -11,7 +11,7 @@ Postfix configuration utility
.fi
\fBManaging main.cf:\fR
\fBpostconf\fR [\fB\-dfhnopvx\fR] [\fB\-c \fIconfig_dir\fR]
\fBpostconf\fR [\fB\-dfhHnopvx\fR] [\fB\-c \fIconfig_dir\fR]
[\fB\-C \fIclass,...\fR] [\fIparameter ...\fR]
\fBpostconf\fR [\fB\-epv\fR] [\fB\-c \fIconfig_dir\fR]
@ -39,7 +39,7 @@ Postfix configuration utility
\fBManaging master.cf service fields:\fR
\fBpostconf\fR \fB\-F\fR [\fB\-fovx\fR] [\fB\-c \fIconfig_dir\fR]
\fBpostconf\fR \fB\-F\fR [\fB\-fhHovx\fR] [\fB\-c \fIconfig_dir\fR]
[\fIservice\fR[\fB/\fItype\fR[\fB/\fIfield\fR]]\fI ...\fR]
\fBpostconf\fR \fB\-F\fR [\fB\-ev\fR] [\fB\-c \fIconfig_dir\fR]
@ -47,7 +47,7 @@ Postfix configuration utility
\fBManaging master.cf service parameters:\fR
\fBpostconf\fR \fB\-P\fR [\fB\-fovx\fR] [\fB\-c \fIconfig_dir\fR]
\fBpostconf\fR \fB\-P\fR [\fB\-fhHovx\fR] [\fB\-c \fIconfig_dir\fR]
[\fIservice\fR[\fB/\fItype\fR[\fB/\fIparameter\fR]]\fI ...\fR]
\fBpostconf\fR \fB\-P\fR [\fB\-ev\fR] [\fB\-c \fIconfig_dir\fR]
@ -203,6 +203,11 @@ This feature is available with Postfix 2.11 and later.
.IP \fB\-h\fR
Show parameter or attribute values without the "\fIname\fR
= " label that normally precedes the value.
.IP \fB\-H\fR
Show parameter or attribute names without the " = \fIvalue\fR"
that normally follows the name.
This feature is available with Postfix 3.1 and later.
.IP \fB\-l\fR
List the names of all supported mailbox locking methods.
Postfix supports the following methods:
@ -527,3 +532,8 @@ Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA

View File

@ -88,3 +88,8 @@ Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA

View File

@ -13346,3 +13346,10 @@ Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
.sp
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
.sp
Viktor Dukhovni

View File

@ -1,6 +1,6 @@
#!/bin/sh
HTML2TEXT="html2text -style pretty -rcfile html2text.rc"
HTML2TEXT="html2text -ascii -style pretty -rcfile html2text.rc"
#case $# in
# 0) $HTML2TEXT;;

View File

@ -14,3 +14,10 @@ Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
.sp
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
.sp
Viktor Dukhovni

View File

@ -117,7 +117,7 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \
valid_mailhost_addr own_inet_addr header_body_checks \
data_redirect addr_match_list safe_ultostr verify_sender_addr \
mail_version mail_dict server_acl uxtext mail_parm_split \
fold_addr
fold_addr smtp_reply_footer
LIBS = ../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX)
LIB_DIR = ../../lib
@ -373,11 +373,15 @@ mail_parm_split: mail_parm_split.c $(LIB) $(LIBS)
fold_addr: fold_addr.c $(LIB) $(LIBS)
$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
smtp_reply_footer: smtp_reply_footer.c $(LIB) $(LIBS)
$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
tests: tok822_test mime_tests strip_addr_test tok822_limit_test \
xtext_test scache_multi_test ehlo_mask_test \
namadr_list_test mail_conf_time_test header_body_checks_tests \
mail_version_test server_acl_test resolve_local_test maps_test \
safe_ultostr_test mail_parm_split_test fold_addr_test
safe_ultostr_test mail_parm_split_test fold_addr_test \
smtp_reply_footer_test
mime_tests: mime_test mime_nest mime_8bit mime_dom mime_trunc mime_cvt \
mime_cvt2 mime_cvt3 mime_garb1 mime_garb2 mime_garb3 mime_garb4
@ -647,6 +651,11 @@ fold_addr_test: fold_addr fold_addr_test.in fold_addr_test.ref
diff fold_addr_test.ref fold_addr_test.tmp
rm -f fold_addr_test.tmp
smtp_reply_footer_test: smtp_reply_footer smtp_reply_footer.ref
$(SHLIB_ENV) ./smtp_reply_footer >smtp_reply_footer.tmp 2>&1
diff smtp_reply_footer.ref smtp_reply_footer.tmp
rm -f smtp_reply_footer.tmp
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck

View File

@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
#define MAIL_RELEASE_DATE "20160104"
#define MAIL_RELEASE_DATE "20160117"
#define MAIL_VERSION_NUMBER "3.1"
#ifdef SNAPSHOT

View File

@ -10,7 +10,7 @@
/* lookup, context)
/* VSTRING *buffer;
/* ssize_t start;
/* char *template;
/* const char *template;
/* const char *filter;
/* const char *(*lookup) (const char *name, void *context);
/* void *context;
@ -50,8 +50,9 @@
/* SEE ALSO
/* mac_expand(3) macro expansion
/* DIAGNOSTICS
/* smtp_reply_footer() returns 0 upon success, -1 if the
/* existing reply text is malformed.
/* smtp_reply_footer() returns 0 upon success, -1 if the existing
/* reply text is malformed, -2 in the case of a template macro
/* parsing error (an undefined macro value is not an error).
/*
/* Fatal errors: memory allocation problem.
/* LICENSE
@ -63,6 +64,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -74,6 +80,7 @@
/* Utility library. */
#include <msg.h>
#include <mymalloc.h>
#include <vstring.h>
/* Global library. */
@ -86,7 +93,7 @@
#define STR vstring_str
int smtp_reply_footer(VSTRING *buffer, ssize_t start,
char *template,
const char *template,
const char *filter,
MAC_EXP_LOOKUP_FN lookup,
void *context)
@ -95,9 +102,14 @@ int smtp_reply_footer(VSTRING *buffer, ssize_t start,
char *cp;
char *next;
char *end;
ssize_t dsn_len;
ssize_t dsn_len; /* last status code length */
ssize_t dsn_offs = -1; /* last status code offset */
int crlf_at_end = 0;
ssize_t reply_patch_undo_offs = -1;
ssize_t reply_code_offs = -1; /* last SMTP reply code offset */
ssize_t reply_patch_undo_len; /* length without final CRLF */
int mac_expand_error = 0;
int line_added;
char *saved_template;
/*
* Sanity check.
@ -108,15 +120,15 @@ int smtp_reply_footer(VSTRING *buffer, ssize_t start,
msg_panic("%s: empty template", myname);
/*
* Scan and patch the original response. If the response is not what we
* expect, we stop making changes.
* Scan the original response without making changes. If the response is
* not what we expect, report an error. Otherwise, remember the offset of
* the last SMTP reply code.
*/
for (cp = STR(buffer) + start, end = cp + strlen(cp);;) {
if (!ISDIGIT(cp[0]) || !ISDIGIT(cp[1]) || !ISDIGIT(cp[2])
|| (cp[3] != ' ' && cp[3] != '-'))
return (-1);
cp[3] = '-';
reply_patch_undo_offs = cp + 3 - STR(buffer);
reply_code_offs = cp - STR(buffer);
if ((next = strstr(cp, "\r\n")) == 0) {
next = end;
break;
@ -127,53 +139,150 @@ int smtp_reply_footer(VSTRING *buffer, ssize_t start,
break;
}
}
if (reply_code_offs < 0)
return (-1);
/*
* Truncate text after the first null, and truncate the trailing CRLF.
*/
if (next < vstring_end(buffer))
vstring_truncate(buffer, next - STR(buffer));
reply_patch_undo_len = VSTRING_LEN(buffer);
/*
* Append the footer text one line at a time. Caution: before we append
* parts from the buffer to itself, we must extend the buffer first,
* otherwise we would have a dangling pointer "read" bug.
*
* XXX mac_expand() has no template length argument, so we must
* null-terminate the template in the middle.
*/
dsn_len = dsn_valid(STR(buffer) + start + 4);
for (cp = template, end = cp + strlen(cp);;) {
dsn_offs = reply_code_offs + 4;
dsn_len = dsn_valid(STR(buffer) + dsn_offs);
line_added = 0;
saved_template = mystrdup(template);
for (cp = saved_template, end = cp + strlen(cp);;) {
if ((next = strstr(cp, "\\n")) != 0) {
*next = 0;
} else {
next = end;
}
if (cp == template && strncmp(cp, "\\c", 2) == 0) {
if (cp == saved_template && strncmp(cp, "\\c", 2) == 0) {
/* Handle \c at start of template. */
cp += 2;
} else {
/* Append a clone of the SMTP reply code. */
vstring_strcat(buffer, "\r\n");
VSTRING_SPACE(buffer, 3);
vstring_strncat(buffer, STR(buffer) + start, 3);
vstring_strncat(buffer, STR(buffer) + reply_code_offs, 3);
vstring_strcat(buffer, next != end ? "-" : " ");
/* Append a clone of the optional enhanced status code. */
if (dsn_len > 0) {
VSTRING_SPACE(buffer, dsn_len);
vstring_strncat(buffer, STR(buffer) + start + 4, dsn_len);
vstring_strncat(buffer, STR(buffer) + dsn_offs, dsn_len);
vstring_strcat(buffer, " ");
}
reply_patch_undo_offs = -1;
line_added = 1;
}
/* Append one line of footer text. */
mac_expand(buffer, cp, MAC_EXP_FLAG_APPEND, filter, lookup, context);
mac_expand_error = (mac_expand(buffer, cp, MAC_EXP_FLAG_APPEND, filter,
lookup, context) & MAC_PARSE_ERROR);
if (mac_expand_error)
break;
if (next < end) {
*next = '\\';
cp = next + 2;
} else
break;
}
if (reply_patch_undo_offs > 0)
STR(buffer)[reply_patch_undo_offs] = ' ';
myfree(saved_template);
/* Discard appended text after error, or finalize the result. */
if (mac_expand_error) {
vstring_truncate(buffer, reply_patch_undo_len);
VSTRING_TERMINATE(buffer);
} else if (line_added > 0) {
STR(buffer)[reply_code_offs + 3] = '-';
}
/* Restore CRLF at end. */
if (crlf_at_end)
vstring_strcat(buffer, "\r\n");
return (0);
return (mac_expand_error ? -2 : 0);
}
#ifdef TEST
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <msg.h>
#include <vstream.h>
#include <vstring_vstream.h>
#include <msg_vstream.h>
struct test_case {
const char *title;
const char *orig_reply;
const char *template;
const char *filter;
int expected_status;
const char *expected_reply;
};
#define NO_FILTER ((char *) 0)
#define NO_TEMPLATE "NO_TEMPLATE"
#define NO_ERROR (0)
#define BAD_SMTP (-1)
#define BAD_MACRO (-2)
static struct test_case test_cases[] = {
{"missing reply", "", NO_TEMPLATE, NO_FILTER, BAD_SMTP, 0},
{"long smtp_code", "1234 foo", NO_TEMPLATE, NO_FILTER, BAD_SMTP, 0},
{"short smtp_code", "12 foo", NO_TEMPLATE, NO_FILTER, BAD_SMTP, 0},
{"good+bad smtp_code", "321 foo\r\n1234 foo", NO_TEMPLATE, NO_FILTER, BAD_SMTP, 0},
{"1-line no dsn", "550 Foo", "\\c footer", NO_FILTER, NO_ERROR, "550 Foo footer"},
{"1-line no dsn", "550 Foo", "Bar", NO_FILTER, NO_ERROR, "550-Foo\r\n550 Bar"},
{"2-line no dsn", "550-Foo\r\n550 Bar", "Baz", NO_FILTER, NO_ERROR, "550-Foo\r\n550-Bar\r\n550 Baz"},
{"1-line with dsn", "550 5.1.1 Foo", "Bar", NO_FILTER, NO_ERROR, "550-5.1.1 Foo\r\n550 5.1.1 Bar"},
{"2-line with dsn", "550-5.1.1 Foo\r\n450 4.1.1 Bar", "Baz", NO_FILTER, NO_ERROR, "550-5.1.1 Foo\r\n450-4.1.1 Bar\r\n450 4.1.1 Baz"},
{"bad macro", "220 myhostname", "\\c ${whatever", NO_FILTER, BAD_MACRO, 0},
{"bad macroCRLF", "220 myhostname\r\n", "\\c ${whatever", NO_FILTER, BAD_MACRO, 0},
{"good macro", "220 myhostname", "\\c $whatever", NO_FILTER, NO_ERROR, "220 myhostname DUMMY"},
{"good macroCRLF", "220 myhostname\r\n", "\\c $whatever", NO_FILTER, NO_ERROR, "220 myhostname DUMMY\r\n"},
0,
};
static const char *lookup(const char *name, int unused_mode, void *context)
{
return "DUMMY";
}
int main(int argc, char **argv)
{
struct test_case *tp;
int status;
VSTRING *buf = vstring_alloc(10);
void *context = 0;
msg_vstream_init(argv[0], VSTREAM_ERR);
for (tp = test_cases; tp->title != 0; tp++) {
vstring_strcpy(buf, tp->orig_reply);
status = smtp_reply_footer(buf, 0, tp->template, tp->filter,
lookup, context);
if (status != tp->expected_status) {
msg_warn("test \"%s\": status %d, expected %d",
tp->title, status, tp->expected_status);
} else if (status < 0 && strcmp(STR(buf), tp->orig_reply) != 0) {
msg_warn("test \"%s\": result \"%s\", expected \"%s\"",
tp->title, STR(buf), tp->orig_reply);
} else if (status == 0 && strcmp(STR(buf), tp->expected_reply) != 0) {
msg_warn("test \"%s\": result \"%s\", expected \"%s\"",
tp->title, STR(buf), tp->expected_reply);
} else {
msg_info("test \"%s\": pass", tp->title);
}
}
vstring_free(buf);
exit(0);
}
#endif

View File

@ -20,7 +20,7 @@
/*
* External interface.
*/
extern int smtp_reply_footer(VSTRING *, ssize_t, char *, const char *,
extern int smtp_reply_footer(VSTRING *, ssize_t, const char *, const char *,
MAC_EXP_LOOKUP_FN, void *);
/* LICENSE
@ -32,6 +32,11 @@ extern int smtp_reply_footer(VSTRING *, ssize_t, char *, const char *,
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
#endif

View File

@ -0,0 +1,15 @@
./smtp_reply_footer: test "missing reply": pass
./smtp_reply_footer: test "long smtp_code": pass
./smtp_reply_footer: test "short smtp_code": pass
./smtp_reply_footer: test "good+bad smtp_code": pass
./smtp_reply_footer: test "1-line no dsn": pass
./smtp_reply_footer: test "1-line no dsn": pass
./smtp_reply_footer: test "2-line no dsn": pass
./smtp_reply_footer: test "1-line with dsn": pass
./smtp_reply_footer: test "2-line with dsn": pass
./smtp_reply_footer: warning: truncated macro reference: " ${whatever"
./smtp_reply_footer: test "bad macro": pass
./smtp_reply_footer: warning: truncated macro reference: " ${whatever"
./smtp_reply_footer: test "bad macroCRLF": pass
./smtp_reply_footer: test "good macro": pass
./smtp_reply_footer: test "good macroCRLF": pass

View File

@ -49,7 +49,8 @@ tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \
test22 test23 test24 test25 test26 test27 test28 test29 test30 test4b \
test31 test32 test33 test34 test35 test36 test37 test39 test40 test41 \
test42 test43 test44 test45 test46 test47 test48 test49 test50 test51 \
test52 test53 test54 test55 test56 test57 test58 test59
test52 test53 test54 test55 test56 test57 test58 test59 test60 test61 \
test62 test63
root_tests:
@ -805,6 +806,46 @@ test59: $(PROG) test59.ref
diff test59.ref test59.tmp
rm -f main.cf master.cf test59.tmp
test60: $(PROG) test60.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(SHLIB_ENV) ./$(PROG) -Fhc. >test60.tmp 2>&1 || true
diff test60.ref test60.tmp
rm -f main.cf master.cf test60.tmp
test61: $(PROG) test61.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(SHLIB_ENV) ./$(PROG) -Phc. >test61.tmp 2>&1 || true
diff test61.ref test61.tmp
rm -f main.cf master.cf test61.tmp
test62: $(PROG) test62.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(SHLIB_ENV) ./$(PROG) -FHc. >test62.tmp 2>&1 || true
diff test62.ref test62.tmp
rm -f main.cf master.cf test62.tmp
test63: $(PROG) test63.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(SHLIB_ENV) ./$(PROG) -PHc. >test63.tmp 2>&1 || true
diff test63.ref test63.tmp
rm -f main.cf master.cf test63.tmp
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck

View File

@ -7,7 +7,7 @@
/* .fi
/* \fBManaging main.cf:\fR
/*
/* \fBpostconf\fR [\fB-dfhnopvx\fR] [\fB-c \fIconfig_dir\fR]
/* \fBpostconf\fR [\fB-dfhHnopvx\fR] [\fB-c \fIconfig_dir\fR]
/* [\fB-C \fIclass,...\fR] [\fIparameter ...\fR]
/*
/* \fBpostconf\fR [\fB-epv\fR] [\fB-c \fIconfig_dir\fR]
@ -35,7 +35,7 @@
/*
/* \fBManaging master.cf service fields:\fR
/*
/* \fBpostconf\fR \fB-F\fR [\fB-fovx\fR] [\fB-c \fIconfig_dir\fR]
/* \fBpostconf\fR \fB-F\fR [\fB-fhHovx\fR] [\fB-c \fIconfig_dir\fR]
/* [\fIservice\fR[\fB/\fItype\fR[\fB/\fIfield\fR]]\fI ...\fR]
/*
/* \fBpostconf\fR \fB-F\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
@ -43,7 +43,7 @@
/*
/* \fBManaging master.cf service parameters:\fR
/*
/* \fBpostconf\fR \fB-P\fR [\fB-fovx\fR] [\fB-c \fIconfig_dir\fR]
/* \fBpostconf\fR \fB-P\fR [\fB-fhHovx\fR] [\fB-c \fIconfig_dir\fR]
/* [\fIservice\fR[\fB/\fItype\fR[\fB/\fIparameter\fR]]\fI ...\fR]
/*
/* \fBpostconf\fR \fB-P\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
@ -197,6 +197,11 @@
/* .IP \fB-h\fR
/* Show parameter or attribute values without the "\fIname\fR
/* = " label that normally precedes the value.
/* .IP \fB-H\fR
/* Show parameter or attribute names without the " = \fIvalue\fR"
/* that normally follows the name.
/*
/* This feature is available with Postfix 3.1 and later.
/* .IP \fB-l\fR
/* List the names of all supported mailbox locking methods.
/* Postfix supports the following methods:
@ -505,6 +510,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -572,7 +582,8 @@ static const int pcf_incompat_options[] = {
PCF_SHOW_EVAL | PCF_EDIT_CONF | PCF_COMMENT_OUT | PCF_EDIT_EXCL,
PCF_MAIN_OVER | PCF_SHOW_DEFS | PCF_EDIT_CONF | PCF_COMMENT_OUT \
|PCF_EDIT_EXCL,
PCF_HIDE_NAME | PCF_EDIT_CONF | PCF_COMMENT_OUT | PCF_EDIT_EXCL,
PCF_HIDE_NAME | PCF_EDIT_CONF | PCF_COMMENT_OUT | PCF_EDIT_EXCL \
|PCF_HIDE_VALUE,
0,
};
@ -592,13 +603,14 @@ static const int pcf_compat_options[][2] = {
{PCF_MAIN_PARAM, (PCF_EDIT_CONF | PCF_EDIT_EXCL | PCF_COMMENT_OUT \
|PCF_FOLD_LINE | PCF_HIDE_NAME | PCF_PARAM_CLASS \
|PCF_SHOW_EVAL | PCF_SHOW_DEFS | PCF_SHOW_NONDEF \
|PCF_MAIN_OVER)},
|PCF_MAIN_OVER | PCF_HIDE_VALUE)},
{PCF_MASTER_ENTRY, (PCF_EDIT_CONF | PCF_EDIT_EXCL | PCF_COMMENT_OUT \
|PCF_FOLD_LINE | PCF_MAIN_OVER | PCF_SHOW_EVAL)},
{PCF_MASTER_FLD, (PCF_EDIT_CONF | PCF_FOLD_LINE | PCF_HIDE_NAME \
|PCF_MAIN_OVER | PCF_SHOW_EVAL)},
|PCF_MAIN_OVER | PCF_SHOW_EVAL | PCF_HIDE_VALUE)},
{PCF_MASTER_PARAM, (PCF_EDIT_CONF | PCF_EDIT_EXCL | PCF_FOLD_LINE \
|PCF_HIDE_NAME | PCF_MAIN_OVER | PCF_SHOW_EVAL)},
|PCF_HIDE_NAME | PCF_MAIN_OVER | PCF_SHOW_EVAL \
|PCF_HIDE_VALUE)},
/* Modifiers. */
{PCF_PARAM_CLASS, (PCF_MAIN_PARAM | PCF_SHOW_DEFS | PCF_SHOW_NONDEF)},
0,
@ -617,6 +629,7 @@ static const NAME_MASK pcf_compat_names[] = {
"-f", PCF_FOLD_LINE,
"-F", PCF_MASTER_FLD,
"-h", PCF_HIDE_NAME,
"-H", PCF_HIDE_VALUE,
"-l", PCF_SHOW_LOCKS,
"-m", PCF_SHOW_MAPS,
"-M", PCF_MASTER_ENTRY,
@ -646,6 +659,7 @@ static void usage(const char *progname)
" [-f (fold lines)]"
" [-F (master.cf fields)]"
" [-h (no names)]"
" [-H (no values)]"
" [-l (lock types)]"
" [-m (map types)]"
" [-M (master.cf)]"
@ -749,7 +763,7 @@ int main(int argc, char **argv)
/*
* Parse JCL.
*/
while ((ch = GETOPT(argc, argv, "aAbc:C:deEfFhlmMno:pPtvxX#")) > 0) {
while ((ch = GETOPT(argc, argv, "aAbc:C:deEfFhHlmMno:pPtvxX#")) > 0) {
switch (ch) {
case 'a':
pcf_cmd_mode |= PCF_SHOW_SASL_SERV;
@ -790,6 +804,9 @@ int main(int argc, char **argv)
case 'h':
pcf_cmd_mode |= PCF_HIDE_NAME;
break;
case 'H':
pcf_cmd_mode |= PCF_HIDE_VALUE;
break;
case 'l':
pcf_cmd_mode |= PCF_SHOW_LOCKS;
break;

View File

@ -44,6 +44,7 @@
#define PCF_MAIN_OVER (1<<17) /* override parameter values */
#define PCF_DUMP_DSN_TEMPL (1<<18) /* show bounce templates */
#define PCF_MASTER_PARAM (1<<19) /* manage master.cf -o name=value */
#define PCF_HIDE_VALUE (1<<20) /* hide main.cf/master.cf =value */
#define PCF_DEF_MODE 0
@ -312,4 +313,9 @@ extern void pcf_show_sasl(int);
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/

View File

@ -30,6 +30,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */

View File

@ -63,6 +63,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -146,6 +151,9 @@ static void pcf_print_parameter(VSTREAM *fp, int mode, const char *name,
* or without the name= prefix.
*/
if (value != 0) {
if (mode & PCF_HIDE_VALUE) {
pcf_print_line(fp, mode, "%s\n", name);
} else {
if ((mode & PCF_SHOW_EVAL) != 0 && PCF_RAW_PARAMETER(node) == 0)
value = pcf_expand_parameter_value((VSTRING *) 0, mode, value,
(PCF_MASTER_ENT *) 0);
@ -154,6 +162,7 @@ static void pcf_print_parameter(VSTREAM *fp, int mode, const char *name,
} else {
pcf_print_line(fp, mode, "%s\n", value);
}
}
if (msg_verbose)
vstream_fflush(fp);
}

View File

@ -132,6 +132,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -659,20 +664,24 @@ static void pcf_print_master_field(VSTREAM *fp, int mode,
ADD_TEXT(argv[1], strlen(argv[1]));
ADD_CHAR(PCF_NAMESP_SEP_STR);
ADD_TEXT(pcf_str_field_pattern(field), strlen(pcf_str_field_pattern(field)));
}
if ((mode & (PCF_HIDE_NAME | PCF_HIDE_VALUE)) == 0) {
ADD_TEXT(" = ", 3);
if (line_len + strlen(argv[field]) > PCF_LINE_LIMIT) {
}
if ((mode & PCF_HIDE_VALUE) == 0) {
if (line_len > 0 && line_len + strlen(argv[field]) > PCF_LINE_LIMIT) {
vstream_fputs("\n" PCF_INDENT_TEXT, fp);
line_len = PCF_INDENT_LEN;
}
}
ADD_TEXT(argv[field], strlen(argv[field]));
}
/*
* Format the daemon command-line options and non-option arguments. Here,
* we have no data-dependent preference for column positions, but we do
* have argument grouping preferences.
*/
if (field == PCF_MASTER_FLD_CMD) {
if (field == PCF_MASTER_FLD_CMD && (mode & PCF_HIDE_VALUE) == 0) {
in_daemon_options = 1;
for (field += 1; (arg = argv[field]) != 0; field++) {
arg_len = strlen(arg);
@ -853,6 +862,11 @@ static void pcf_print_master_param(VSTREAM *fp, int mode,
const char *param_name,
const char *param_value)
{
if (mode & PCF_HIDE_VALUE) {
pcf_print_line(fp, mode, "%s%c%s\n",
masterp->name_space, PCF_NAMESP_SEP_CH,
param_name);
} else {
if ((mode & PCF_SHOW_EVAL) != 0)
param_value = pcf_expand_parameter_value((VSTRING *) 0, mode,
param_value, masterp);
@ -863,6 +877,7 @@ static void pcf_print_master_param(VSTREAM *fp, int mode,
} else {
pcf_print_line(fp, mode, "%s\n", param_value);
}
}
if (msg_verbose)
vstream_fflush(fp);
}

View File

@ -28,6 +28,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */

View File

@ -13,3 +13,4 @@ whatevershebrings_minimum_delivery_slots = $default_minimum_delivery_slots
whatevershebrings_recipient_limit = $default_recipient_limit
whatevershebrings_recipient_refill_delay = $default_recipient_refill_delay
whatevershebrings_recipient_refill_limit = $default_recipient_refill_limit
whatevershebrings_transport_rate_delay = $default_transport_rate_delay

View File

@ -13,3 +13,4 @@ whatevershebrings_minimum_delivery_slots = $default_minimum_delivery_slots
whatevershebrings_recipient_limit = $default_recipient_limit
whatevershebrings_recipient_refill_delay = $default_recipient_refill_delay
whatevershebrings_recipient_refill_limit = $default_recipient_refill_limit
whatevershebrings_transport_rate_delay = $default_transport_rate_delay

View File

@ -13,3 +13,4 @@ whatevershebrings_minimum_delivery_slots = $default_minimum_delivery_slots
whatevershebrings_recipient_limit = $default_recipient_limit
whatevershebrings_recipient_refill_delay = $default_recipient_refill_delay
whatevershebrings_recipient_refill_limit = $default_recipient_refill_limit
whatevershebrings_transport_rate_delay = $default_transport_rate_delay

View File

@ -14,3 +14,4 @@ whatevershebrings_recipient_limit = $default_recipient_limit
whatevershebrings_recipient_refill_delay = $default_recipient_refill_delay
whatevershebrings_recipient_refill_limit = $default_recipient_refill_limit
whatevershebrings_time_limit = $command_time_limit
whatevershebrings_transport_rate_delay = $default_transport_rate_delay

View File

@ -0,0 +1,8 @@
foo
unix
-
n
n
-
0
other -o always_bcc=bar

View File

@ -0,0 +1 @@
bar

View File

@ -0,0 +1,8 @@
foo/unix/service
foo/unix/type
foo/unix/private
foo/unix/unprivileged
foo/unix/chroot
foo/unix/wakeup
foo/unix/process_limit
foo/unix/command

View File

@ -0,0 +1 @@
foo/unix/always_bcc

View File

@ -72,6 +72,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */

View File

@ -461,7 +461,7 @@ static const char *tls_exclude_missing(SSL_CTX *ctx, VSTRING *buf)
static ARGV *exclude; /* Cached */
SSL *s = 0;
ssl_cipher_stack_t *ciphers;
SSL_CIPHER *c;
const SSL_CIPHER *c;
const cipher_probe_t *probe;
int alg_bits;
int num;