20111113
+ Portability: specify ``make makefiles "CCARGS=-DNO_NIS
+ ..."'' to build on systems without NIS support. Files:
+ makedefs, util/sys_defs.h.
+
Cleanup: documented the postconf algorithms and their
limitations, and added regression tests to speed up future
development. File: postconf/postconf.c
20111121
Cleanup: documentation fixes. File: postconf/postconf.c.
+
+ Cleanup: in postconf "main.cf management" mode, errors
+ opening master.cf are non-fatal. File: postconf/postconf.c.
+
+20111122
+
+ Cleanup: documentation examples to request VERP-style
+ delivery at SMTP time with the smtpd_command_filter feature.
+ Files: proto/VERP_README.html, proto/postconf.proto.
authorized_verp_clients (default: $mynetworks).
disable_verp_bounces (default: no)
- if Postfix sends one bounce report for multi-recipient VERP mail, or one
- bounce report per recipient. The default, one per recipient, is what ezmlm
- needs.
+ Send one bounce report for multi-recipient VERP mail, instead of one bounce
+ report per recipient. The default, one per recipient, is what ezmlm needs.
U\bUs\bsi\bin\bng\bg V\bVE\bER\bRP\bP w\bwi\bit\bth\bh m\bma\baj\bjo\bor\brd\bdo\bom\bmo\bo e\bet\btc\bc.\b. m\bma\bai\bil\bli\bin\bng\bg l\bli\bis\bst\bts\bs
The first form uses the default main.cf VERP delimiters, the second form
overrides them explicitly. The values shown are the recommended ones.
+You can use the smtpd_command_filter feature to append XVERP to SMTP commands
+from legacy sofware. This requires Postfix 2.7 or later.
+
+ /etc/postfix/main.cf:
+ smtpd_command_filter = pcre:/etc/postfix/append_verp.pcre
+ smtpd_authorized_verp_clients = $mynetworks
+
+ /etc/postfix/append_verp.pcre:
+ /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+
V\bVE\bER\bRP\bP s\bsu\bup\bpp\bpo\bor\brt\bt i\bin\bn t\bth\bhe\be P\bPo\bos\bst\btf\bfi\bix\bx s\bse\ben\bnd\bdm\bma\bai\bil\bl c\bco\bom\bmm\bma\ban\bnd\bd
The Postfix sendmail command has a -V flag to request VERP style delivery.
<dt> <a href="postconf.5.html#disable_verp_bounces">disable_verp_bounces</a> (default: no)
- <dd> <p> if Postfix sends one bounce report for multi-recipient
- VERP mail, or one bounce report per recipient. The default,
+ <dd> <p> Send one bounce report for multi-recipient VERP mail,
+ instead of one bounce report per recipient. The default,
one per recipient, is what ezmlm needs. </p> </dd>
</dl>
second form overrides them explicitly. The values shown are the
recommended ones. </p>
+<p> You can use the <a href="postconf.5.html#smtpd_command_filter">smtpd_command_filter</a> feature to append XVERP
+to SMTP commands from legacy sofware. This requires Postfix 2.7
+or later. </p>
+
+<blockquote>
+<pre>
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
+ <a href="postconf.5.html#smtpd_command_filter">smtpd_command_filter</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/append_verp.pcre
+ <a href="postconf.5.html#smtpd_authorized_verp_clients">smtpd_authorized_verp_clients</a> = $<a href="postconf.5.html#mynetworks">mynetworks</a>
+
+/etc/postfix/append_verp.<a href="pcre_table.5.html">pcre</a>:
+ /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+</pre>
+</blockquote>
+
<h2> <a name="sendmail"> VERP support in the Postfix sendmail command </a> </h2>
<p> The Postfix sendmail command has a -V flag to request VERP style
parameter settings with the "<i>name</i>=<i>value</i>" pairs on
the <a href="postconf.1.html"><b>postconf</b>(1)</a> command line. The file is copied to
a temporary file then renamed into place. Specify
- quotes to protect shell metacharacters and white-
- space.
+ quotes to protect special characters and whitespace
+ on the f<a href="postconf.1.html">Bpostconf(1)</a> command line.
The <b>-e</b> is no longer needed with Postfix version 2.8
and later.
verbose.
<b>-#</b> Edit the <a href="postconf.5.html"><b>main.cf</b></a> configuration file, and comment
- out the specified parameters so that they revert to
- their default values. The file is copied to a tem-
- porary file then renamed into place. Specify a
- list of parameter names, not <i>name</i>=<i>value</i> pairs.
- There is no <a href="postconf.1.html"><b>postconf</b>(1)</a> command to perform the
- reverse operation.
-
- This feature is available with Postfix 2.6 and
+ out the parameters given on the <a href="postconf.1.html"><b>postconf</b>(1)</a> command
+ line, so that those parameters revert to their
+ default values. The file is copied to a temporary
+ file then renamed into place. Specify a list of
+ parameter names, not <i>name</i>=<i>value</i> pairs. There is no
+ <a href="postconf.1.html"><b>postconf</b>(1)</a> command to perform the reverse opera-
+ tion.
+
+ This feature is available with Postfix 2.6 and
later.
<b>DIAGNOSTICS</b>
Directory with Postfix configuration files.
<b>CONFIGURATION PARAMETERS</b>
- The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant
+ The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant
to this program.
- The text below provides only a parameter summary. See
+ The text below provides only a parameter summary. See
<a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
<b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
- The default location of the Postfix <a href="postconf.5.html">main.cf</a> and
+ The default location of the Postfix <a href="postconf.5.html">main.cf</a> and
<a href="master.5.html">master.cf</a> configuration files.
<b><a href="postconf.5.html#bounce_template_file">bounce_template_file</a> (empty)</b>
- Pathname of a configuration file with bounce mes-
+ Pathname of a configuration file with bounce mes-
sage templates.
<b>FILES</b>
<a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
/^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2
</pre>
+<pre>
+ # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+ # See <a href="VERP_README.html">VERP_README</a> for more information on how to use Postfix VERP.
+ /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+</pre>
+
<pre>
# Bounce-never mail sink. Use <a href="postconf.5.html#notify_classes">notify_classes</a>=bounce,resource,software
# to send bounced mail to the postmaster (with message body removed).
parameter settings with the "\fIname\fR=\fIvalue\fR" pairs
on the \fBpostconf\fR(1) command line. The file is copied
to a temporary file then renamed into place.
-Specify quotes to protect shell metacharacters and whitespace.
+Specify quotes to protect special characters and whitespace
+on the fBpostconf\fR(1) command line.
The \fB-e\fR is no longer needed with Postfix version 2.8
and later.
options make the software increasingly verbose.
.IP \fB-#\fR
Edit the \fBmain.cf\fR configuration file, and comment out
-the specified parameters so that they revert to their default
-values. The file is copied to a temporary file then renamed
-into place.
+the parameters given on the \fBpostconf\fR(1) command line,
+so that those parameters revert to their default values.
+The file is copied to a temporary file then renamed into
+place.
Specify a list of parameter names, not \fIname\fR=\fIvalue\fR
pairs. There is no \fBpostconf\fR(1) command to perform
the reverse operation.
.PP
.nf
.na
+.ft C
+ # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+ # See VERP_README for more information on how to use Postfix VERP.
+ /^(MAIL FROM:<listname@example\e.com>.*)/ $1 XVERP
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
.ft C
# Bounce-never mail sink. Use notify_classes=bounce,resource,software
# to send bounced mail to the postmaster (with message body removed).
<dt> disable_verp_bounces (default: no)
- <dd> <p> if Postfix sends one bounce report for multi-recipient
- VERP mail, or one bounce report per recipient. The default,
+ <dd> <p> Send one bounce report for multi-recipient VERP mail,
+ instead of one bounce report per recipient. The default,
one per recipient, is what ezmlm needs. </p> </dd>
</dl>
second form overrides them explicitly. The values shown are the
recommended ones. </p>
+<p> You can use the smtpd_command_filter feature to append XVERP
+to SMTP commands from legacy sofware. This requires Postfix 2.7
+or later. </p>
+
+<blockquote>
+<pre>
+/etc/postfix/main.cf:
+ smtpd_command_filter = pcre:/etc/postfix/append_verp.pcre
+ smtpd_authorized_verp_clients = $mynetworks
+
+/etc/postfix/append_verp.pcre:
+ /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+</pre>
+</blockquote>
+
<h2> <a name="sendmail"> VERP support in the Postfix sendmail command </a> </h2>
<p> The Postfix sendmail command has a -V flag to request VERP style
/^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2
</pre>
+<pre>
+ # Append XVERP to MAIL FROM commands to request VERP-style delivery.
+ # See VERP_README for more information on how to use Postfix VERP.
+ /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP
+</pre>
+
<pre>
# Bounce-never mail sink. Use notify_classes=bounce,resource,software
# to send bounced mail to the postmaster (with message body removed).
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20111121"
+#define MAIL_RELEASE_DATE "20111122"
#define MAIL_VERSION_NUMBER "2.9"
#ifdef SNAPSHOT
test: $(TESTPROG)
tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \
- test12 test13 test14 test15
+ test12 test13 test14 test15 test16 test17
root_tests:
diff test15.ref test15.tmp
rm -f main.cf master.cf test15.tmp
+# Test graceful degradation if master.cf is unavailable.
+
+test16: $(PROG) test16.ref
+ rm -f main.cf master.cf
+ touch main.cf
+ ./$(PROG) -nc . >test16.tmp 2>&1
+ diff test16.ref test16.tmp
+ rm -f main.cf master.cf test16.tmp
+
+test17: $(PROG) test17.ref
+ rm -f main.cf master.cf
+ touch main.cf
+ -./$(PROG) -Mc . >test17.tmp 2>&1; exit 0
+ diff test17.ref test17.tmp
+ rm -f main.cf master.cf test17.tmp
+
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck
/* Display the message text that appears at the beginning of
/* delivery status notification (DSN) messages, with $\fBname\fR
/* expressions replaced by actual values as described in
-/* \fBbounce\fR(5).
+/* \fBbounce\fR(5).
/*
/* To override the built-in templates, specify a template file
/* name at the end of the \fBpostconf\fR(1) command line, or
/* Edit the \fBmain.cf\fR configuration file, and update
/* parameter settings with the "\fIname\fR=\fIvalue\fR" pairs
/* on the \fBpostconf\fR(1) command line. The file is copied
-/* to a temporary file then renamed into place.
-/* Specify quotes to protect shell metacharacters and whitespace.
+/* to a temporary file then renamed into place.
+/* Specify quotes to protect special characters and whitespace
+/* on the fBpostconf\fR(1) command line.
/*
/* The \fB-e\fR is no longer needed with Postfix version 2.8
/* and later.
/* options make the software increasingly verbose.
/* .IP \fB-#\fR
/* Edit the \fBmain.cf\fR configuration file, and comment out
-/* the specified parameters so that they revert to their default
-/* values. The file is copied to a temporary file then renamed
-/* into place.
+/* the parameters given on the \fBpostconf\fR(1) command line,
+/* so that those parameters revert to their default values.
+/* The file is copied to a temporary file then renamed into
+/* place.
/* Specify a list of parameter names, not \fIname\fR=\fIvalue\fR
/* pairs. There is no \fBpostconf\fR(1) command to perform
/* the reverse operation.
* The proposal below describes some of the steps needed to expand
* parameter values. It has a problem: it updates the configuration
* parameter dictionary, and in doing so breaks the "postconf -d"
- * implementation.
+ * implementation. This makes "-d" and "-e" mutually exclusive.
*
* Populate the configuration parameter dictionary with default settings or
* with actual settings.
/* read_master - read and digest the master.cf file */
-static void read_master(void)
+static void read_master(int fail_on_open_error)
{
char *path;
- VSTRING *buf = vstring_alloc(100);
+ VSTRING *buf;
ARGV *argv;
VSTREAM *fp;
int entry_count = 0;
master_table = (PC_MASTER_ENT *) mymalloc(sizeof(*master_table));
/*
- * Skip blank lines and comment lines.
+ * Skip blank lines and comment lines. Degrade gracefully if master.cf is
+ * not available, and master.cf is not the primary target.
*/
- if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0)
- msg_fatal("open %s: %m", path);
- while (readlline(buf, fp, &line_count) != 0) {
- master_table = (PC_MASTER_ENT *) myrealloc((char *) master_table,
+#define WARN_ON_OPEN_ERROR 0
+#define FAIL_ON_OPEN_ERROR 1
+
+ if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0) {
+ if (fail_on_open_error)
+ msg_fatal("open %s: %m", path);
+ msg_warn("open %s: %m", path);
+ } else {
+ buf = vstring_alloc(100);
+ while (readlline(buf, fp, &line_count) != 0) {
+ master_table = (PC_MASTER_ENT *) myrealloc((char *) master_table,
(entry_count + 2) * sizeof(*master_table));
- argv = argv_split(STR(buf), MASTER_BLANKS);
- if (argv->argc < MASTER_FIELD_COUNT)
- msg_fatal("file %s: line %d: bad field count", path, line_count);
- master_table[entry_count].name_space =
- concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0);
- master_table[entry_count].argv = argv;
- master_table[entry_count].valid_names = 0;
- master_table[entry_count].all_params = 0;
- entry_count += 1;
+ argv = argv_split(STR(buf), MASTER_BLANKS);
+ if (argv->argc < MASTER_FIELD_COUNT)
+ msg_fatal("file %s: line %d: bad field count",
+ path, line_count);
+ master_table[entry_count].name_space =
+ concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0);
+ master_table[entry_count].argv = argv;
+ master_table[entry_count].valid_names = 0;
+ master_table[entry_count].all_params = 0;
+ entry_count += 1;
+ }
+ vstream_fclose(fp);
+ vstring_free(buf);
}
/*
* Null-terminate the master table and clean up.
*/
master_table[entry_count].argv = 0;
- vstream_fclose(fp);
myfree(path);
- vstring_free(buf);
}
/*
/* flag_user_parameter - flag user-defined name "valid" if it has name=value */
static const char *flag_user_parameter(const char *mac_name,
- int unused_mode,
- char *context)
+ int unused_mode,
+ char *context)
{
PC_MASTER_ENT *local_scope = (PC_MASTER_ENT *) context;
* If showing master.cf entries, show them and exit
*/
else if (cmd_mode & SHOW_MASTER) {
- read_master();
+ read_master(FAIL_ON_OPEN_ERROR);
show_master(cmd_mode, argv + optind);
}
* and user-defined parameters ($name macros in parameter values in
* main.cf and master.cf).
*/
- read_master();
+ read_master(WARN_ON_OPEN_ERROR);
add_service_parameters();
if ((cmd_mode & SHOW_DEFS) == 0)
add_user_parameters();
--- /dev/null
+./postconf: warning: open ./master.cf: No such file or directory
+config_directory = .
--- /dev/null
+./postconf: fatal: open ./master.cf: No such file or directory