]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.9-20111106
authorWietse Venema <wietse@porcupine.org>
Sun, 6 Nov 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:37:33 +0000 (06:37 +0000)
29 files changed:
postfix/.indent.pro
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/lmtp.8.html
postfix/html/mailq.1.html
postfix/html/newaliases.1.html
postfix/html/postconf.1.html
postfix/html/postconf.5.html
postfix/html/sendmail.1.html
postfix/html/smtp.8.html
postfix/man/man1/postconf.1
postfix/man/man5/postconf.5
postfix/man/man8/smtp.8
postfix/mantools/postlink
postfix/proto/postconf.proto
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/postconf/Makefile.in
postfix/src/postconf/postconf.c
postfix/src/postscreen/postscreen.h
postfix/src/postscreen/postscreen_send.c
postfix/src/postscreen/postscreen_smtpd.c
postfix/src/smtp/lmtp_params.c
postfix/src/smtp/smtp.c
postfix/src/smtp/smtp_params.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtpstone/smtp-sink.c
postfix/src/util/vstream.c
postfix/src/util/vstream.h

index 560988d1e825661dcdc355fbd369fa06b7dde6f7..48488243b4d6fa7fe0e2adb9574d685c550d2342 100644 (file)
 -TDSN_BUF
 -TDSN_SPLIT
 -TDSN_STAT
+-TDYNAMIC_TABLE
 -TEDIT_FILE
 -TEVENT_MASK
 -TEXPAND_ATTR
index 71df8695f4fd5efc6a916e6dc7b3b1bbdbcb0f5b..72d11daa4ef39ec764bfd859f91a13ecac347f0a 100644 (file)
@@ -17025,10 +17025,30 @@ Apologies for any names omitted.
 
        Bugfix (introduced: Postfix 2.8): postscreen sent non-compliant
        SMTP responses (220- followed by 421) when it could not
-       hand off a connection to a real smtpd process, causing
-       undefined behavior in the remote SMTP client. The fix
-       redirects the client to the dummy SMTP engine which sends
-       the 421 reply at the first legitimate opportunity.  Problem
-       reported by Ralf Hildebrandt. Files: postscreen/postscreen_send.c,
+       hand off a connection to a real smtpd process, causing some
+       remote SMTP clients to bounce mail. The fix redirects the
+       client to the dummy SMTP engine which sends the 421 reply
+       at the first legitimate opportunity.  Problem reported by
+       Ralf Hildebrandt. Files: postscreen/postscreen_send.c,
        postscreen/postscreen_smtpd.c, postscreen/postscreen.h.
 
+20111102
+
+       Workaround: to improve inter-operability with broken remote
+       SMTP servers, the Postfix SMTP client by default no longer
+       appends the "AUTH=<>" option to the MAIL FROM command.
+       Specify "smtp_send_dummy_mail_auth = yes" to restore the
+       old behavior.
+
+20111106
+
+       Feature: "postconf -M" support to show Postfix's idea of
+       what is in the master.cf file. File: postconf/postconf.c.
+
+       Work in progress: extract mail delivery transport names
+       from master.cf, and provide better postconf(1) support to
+       manipulate main.cf parameters with transport-dependent
+       names.
+
+       Feature: postconf "-f" option to "nicely" format long lines
+       from main.cf or master.cf. File: postconf/postconf.c.
index a021021b38caa050e53f33de5355b02356afda47..a813583f2fcca474af70e564a2392f431083c4b5 100644 (file)
@@ -14,7 +14,15 @@ specifies the release date of a stable release or snapshot release.
 If you upgrade from Postfix 2.7 or earlier, read RELEASE_NOTES-2.8
 before proceeding.
 
-Incompatible changes with snapshot 201110XX
+Incompatible changes with snapshot 20111106
+===========================================
+
+To work around broken remote SMTP servers, the Postfix SMTP client
+by default no longer appends the "AUTH=<>" option to the MAIL FROM
+command.  Specify "smtp_send_dummy_mail_auth = yes" to restore the
+old behavior.
+
+Incompatible changes with snapshot 20111012
 ===========================================
 
 For consistency with the SMTP standard, the smtp_line_length_limit
index 479bf42b2b42f5e54bd8e9bf45761f382491ac8e..cdaee931f724b085bd0e717ec74e787174e854a1 100644 (file)
@@ -168,7 +168,7 @@ SMTP(8)                                                                SMTP(8)
               Defer  mail  delivery when no MX record resolves to
               an IP address.
 
-       <b><a href="postconf.5.html#smtp_line_length_limit">smtp_line_length_limit</a> (990)</b>
+       <b><a href="postconf.5.html#smtp_line_length_limit">smtp_line_length_limit</a> (998)</b>
               The maximal length of message header and body lines
               that Postfix will send via SMTP.
 
@@ -305,6 +305,11 @@ SMTP(8)                                                                SMTP(8)
               SMTP  message  content  line,  or TLS protocol mes-
               sage).
 
+       <b><a href="postconf.5.html#smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a> (no)</b>
+              Whether or not to append the  "AUTH=&lt;&gt;"  option  to
+              the  MAIL  FROM  command in SASL-authenticated SMTP
+              sessions.
+
 <b>MIME PROCESSING CONTROLS</b>
        Available in Postfix version 2.0 and later:
 
@@ -388,6 +393,13 @@ SMTP(8)                                                                SMTP(8)
               delivery  instead  of  returning mail as undeliver-
               able.
 
+       Available in Postfix version 2.9 and later:
+
+       <b><a href="postconf.5.html#smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a> (no)</b>
+              Whether or not to append the  "AUTH=&lt;&gt;"  option  to
+              the  MAIL  FROM  command in SASL-authenticated SMTP
+              sessions.
+
 <b>STARTTLS SUPPORT CONTROLS</b>
        Detailed information about STARTTLS configuration  may  be
        found in the <a href="TLS_README.html">TLS_README</a> document.
index 9cec093fd9629a1ebaad7e5e18594a5c73128869..3b6255593b2c3b7d10cd31160425bbbac36597e4 100644 (file)
@@ -324,7 +324,7 @@ SENDMAIL(1)                                                        SENDMAIL(1)
 <b>COMPATIBILITY CONTROLS</b>
        Available with Postfix 2.9 and later:
 
-       <b>sendmail_fix_line_endings (always)</b>
+       <b><a href="postconf.5.html#sendmail_fix_line_endings">sendmail_fix_line_endings</a> (always)</b>
               Controls how the Postfix sendmail command  converts
               email  message line endings from &lt;CR&gt;&lt;LF&gt; into UNIX
               format (&lt;LF&gt;).
index 9cec093fd9629a1ebaad7e5e18594a5c73128869..3b6255593b2c3b7d10cd31160425bbbac36597e4 100644 (file)
@@ -324,7 +324,7 @@ SENDMAIL(1)                                                        SENDMAIL(1)
 <b>COMPATIBILITY CONTROLS</b>
        Available with Postfix 2.9 and later:
 
-       <b>sendmail_fix_line_endings (always)</b>
+       <b><a href="postconf.5.html#sendmail_fix_line_endings">sendmail_fix_line_endings</a> (always)</b>
               Controls how the Postfix sendmail command  converts
               email  message line endings from &lt;CR&gt;&lt;LF&gt; into UNIX
               format (&lt;LF&gt;).
index ea7d041443c4b7f9d06400f361957033d33a1dea..34c1219e45309897b77648c270a61585c4bee062 100644 (file)
@@ -10,9 +10,9 @@ POSTCONF(1)                                                        POSTCONF(1)
        postconf - Postfix configuration utility
 
 <b>SYNOPSIS</b>
-       <b>postconf</b> [<b>-dhnv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter ...</i>]
+       <b>postconf</b> [<b>-dfhnv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter ...</i>]
 
-       <b>postconf</b> [<b>-aAmlv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>]
+       <b>postconf</b> [<b>-aAflmMv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>]
 
        <b>postconf</b> [<b>-ev</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter=value ...</i>]
 
@@ -21,10 +21,10 @@ POSTCONF(1)                                                        POSTCONF(1)
        <b>postconf</b> [<b>-btv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>template</i><b>_</b><i>file</i>]
 
 <b>DESCRIPTION</b>
-       The  <a href="postconf.1.html"><b>postconf</b>(1)</a> command displays the values of configura-
-       tion parameters by default. It can also  change  parameter
-       values,  or  display other configuration information about
-       the Postfix mail system.
+       The  <a href="postconf.1.html"><b>postconf</b>(1)</a>  command  displays  the values of <a href="postconf.5.html"><b>main.cf</b></a>
+       configuration parameters by default. It  can  also  change
+       parameter  values, or display other configuration informa-
+       tion about the Postfix mail system.
 
        Options:
 
@@ -62,7 +62,7 @@ POSTCONF(1)                                                        POSTCONF(1)
               sages, with $<b>name</b> expressions  replaced  by  actual
               values.   To  override  the  built-in message text,
               specify a template file at the end of  the  command
-              line,  or  specify  a template file in <a href="postconf.5.html">main.cf</a> with
+              line,  or  specify  a template file in <a href="postconf.5.html"><b>main.cf</b></a> with
               the  <b><a href="postconf.5.html#bounce_template_file">bounce_template_file</a></b>  parameter.    To   force
               selection  of  the built-in message text templates,
               specify an empty template file name (in shell  lan-
@@ -76,8 +76,8 @@ POSTCONF(1)                                                        POSTCONF(1)
               directory  instead  of  the  default  configuration
               directory.
 
-       <b>-d</b>     Print default parameter settings instead of  actual
-              settings.
+       <b>-d</b>     Print <a href="postconf.5.html"><b>main.cf</b></a> default parameter settings instead of
+              actual settings.
 
        <b>-e</b>     Edit  the  <a href="postconf.5.html"><b>main.cf</b></a>  configuration file. The file is
               copied to a temporary file then renamed into place.
@@ -88,8 +88,16 @@ POSTCONF(1)                                                        POSTCONF(1)
               With  Postfix  version  2.8 and later, the <b>-e</b> is no
               longer needed.
 
-       <b>-h</b>     Show parameter values  only;  do  not  prepend  the
-              "<i>name =</i> " label that normally precedes the value.
+       <b>-f</b>     When printing <a href="postconf.5.html"><b>main.cf</b></a>  or  <a href="master.5.html"><b>master.cf</b></a>  configuration
+              file  entries,  fold long lines for human readabil-
+              ity.
+
+              This feature is  available  with  Postfix  2.9  and
+              later.
+
+       <b>-h</b>     Show  <a href="postconf.5.html"><b>main.cf</b></a> parameter values only; do not prepend
+              the "<i>name =</i> "  label  that  normally  precedes  the
+              value.
 
        <b>-l</b>     List  the  names  of  all supported mailbox locking
               methods.  Postfix supports the following methods:
@@ -219,15 +227,21 @@ POSTCONF(1)                                                        POSTCONF(1)
               Other table types may exist depending on how  Post-
               fix was built.
 
-       <b>-n</b>     Print parameter settings that are not left at their
-              built-in default value, because they are explicitly
-              specified in <a href="postconf.5.html">main.cf</a>.
+       <b>-M</b>     Show  <a href="master.5.html"><b>master.cf</b></a>  file  contents  instead of <a href="postconf.5.html"><b>main.cf</b></a>
+              file contents.  Combine with <b>-f</b> to fold long  lines
+              for human readability.
+
+              This  feature  is  available  with  Postfix 2.9 and
+              later.
+
+       <b>-n</b>     Print <a href="postconf.5.html"><b>main.cf</b></a> parameter settings that  are  explic-
+              itly specified in <a href="postconf.5.html"><b>main.cf</b></a>.
 
        <b>-t</b> [<i>template</i><b>_</b><i>file</i>]
               Display the templates for delivery status notifica-
               tion (DSN) messages. To override the built-in  tem-
               plates,  specify  a template file at the end of the
-              command line, or specify a template file in <a href="postconf.5.html">main.cf</a>
+              command line, or specify a template file in <a href="postconf.5.html"><b>main.cf</b></a>
               with  the <b><a href="postconf.5.html#bounce_template_file">bounce_template_file</a></b> parameter.  To force
               selection of the  built-in  templates,  specify  an
               empty template file name (in shell language: "").
index 45d1e652cbb25c216d5db886ab528c7eb1f887df..35aa2c307aa46f311873d8b4fa8010061a31937c 100644 (file)
@@ -4431,6 +4431,17 @@ for authentication.  The available types are listed with the
 <p> This feature is available in Postfix 2.3 and later. </p>
 
 
+</DD>
+
+<DT><b><a name="lmtp_send_dummy_mail_auth">lmtp_send_dummy_mail_auth</a>
+(default: no)</b></DT><DD>
+
+<p> The LMTP-specific version of the <a href="postconf.5.html#smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a>
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.9 and later.  </p>
+
+
 </DD>
 
 <DT><b><a name="lmtp_send_xforward_command">lmtp_send_xforward_command</a>
@@ -10251,6 +10262,20 @@ for authentication.  The available types are listed with the
 <p> This feature is available in Postfix 2.3 and later. </p>
 
 
+</DD>
+
+<DT><b><a name="smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a>
+(default: no)</b></DT><DD>
+
+<p> Whether or not to append the "AUTH=&lt;&gt;" option to the MAIL
+FROM command in SASL-authenticated SMTP sessions. The default is
+not to send this, to avoid problems with broken remote SMTP servers.
+Before Postfix 2.9 the behavior is as if "<a href="postconf.5.html#smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a>
+= yes".
+
+<p> This feature is available in Postfix 2.9 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="smtp_send_xforward_command">smtp_send_xforward_command</a>
@@ -13266,8 +13291,8 @@ code for rejected requests (default: 554). </dd>
 <dt><b><a name="reject_unknown_recipient_domain">reject_unknown_recipient_domain</a></b></dt>
 
 <dd>Reject the request when Postfix is not final destination for
-the recipient domain, and the RCPT TO domain has no DNS A or MX
-record, or when it has a malformed MX record such as a record with
+the recipient domain, and the RCPT TO domain has 1) no DNS A or MX
+record or 2) a malformed MX record such as a record with
 a zero-length MX hostname (Postfix version 2.3 and later). <br> The
 <a href="postconf.5.html#unknown_address_reject_code">unknown_address_reject_code</a> parameter specifies the numerical
 response code for rejected requests (default: 450).  The response
@@ -13888,8 +13913,8 @@ Postfix version 2.1 and later. </dd>
 <dt><b><a name="reject_unknown_sender_domain">reject_unknown_sender_domain</a></b></dt>
 
 <dd>Reject the request when Postfix is not final destination for
-the sender address, and the MAIL FROM address has no DNS A or MX
-record, or when it has a malformed MX record such as a record with
+the sender address, and the MAIL FROM domain has 1) no DNS A or MX
+record, or 2) a malformed MX record such as a record with
 a zero-length MX hostname (Postfix version 2.3 and later). <br> The
 <a href="postconf.5.html#unknown_address_reject_code">unknown_address_reject_code</a> parameter specifies the numerical
 response code for rejected requests (default: 450).  The response
index 9cec093fd9629a1ebaad7e5e18594a5c73128869..3b6255593b2c3b7d10cd31160425bbbac36597e4 100644 (file)
@@ -324,7 +324,7 @@ SENDMAIL(1)                                                        SENDMAIL(1)
 <b>COMPATIBILITY CONTROLS</b>
        Available with Postfix 2.9 and later:
 
-       <b>sendmail_fix_line_endings (always)</b>
+       <b><a href="postconf.5.html#sendmail_fix_line_endings">sendmail_fix_line_endings</a> (always)</b>
               Controls how the Postfix sendmail command  converts
               email  message line endings from &lt;CR&gt;&lt;LF&gt; into UNIX
               format (&lt;LF&gt;).
index 479bf42b2b42f5e54bd8e9bf45761f382491ac8e..cdaee931f724b085bd0e717ec74e787174e854a1 100644 (file)
@@ -168,7 +168,7 @@ SMTP(8)                                                                SMTP(8)
               Defer  mail  delivery when no MX record resolves to
               an IP address.
 
-       <b><a href="postconf.5.html#smtp_line_length_limit">smtp_line_length_limit</a> (990)</b>
+       <b><a href="postconf.5.html#smtp_line_length_limit">smtp_line_length_limit</a> (998)</b>
               The maximal length of message header and body lines
               that Postfix will send via SMTP.
 
@@ -305,6 +305,11 @@ SMTP(8)                                                                SMTP(8)
               SMTP  message  content  line,  or TLS protocol mes-
               sage).
 
+       <b><a href="postconf.5.html#smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a> (no)</b>
+              Whether or not to append the  "AUTH=&lt;&gt;"  option  to
+              the  MAIL  FROM  command in SASL-authenticated SMTP
+              sessions.
+
 <b>MIME PROCESSING CONTROLS</b>
        Available in Postfix version 2.0 and later:
 
@@ -388,6 +393,13 @@ SMTP(8)                                                                SMTP(8)
               delivery  instead  of  returning mail as undeliver-
               able.
 
+       Available in Postfix version 2.9 and later:
+
+       <b><a href="postconf.5.html#smtp_send_dummy_mail_auth">smtp_send_dummy_mail_auth</a> (no)</b>
+              Whether or not to append the  "AUTH=&lt;&gt;"  option  to
+              the  MAIL  FROM  command in SASL-authenticated SMTP
+              sessions.
+
 <b>STARTTLS SUPPORT CONTROLS</b>
        Detailed information about STARTTLS configuration  may  be
        found in the <a href="TLS_README.html">TLS_README</a> document.
index eed34eb542c38f07955aa1821e8687773a5e5217..af9b6cf32d7dfe688098db953938818c08bab8e7 100644 (file)
@@ -9,10 +9,10 @@ Postfix configuration utility
 .na
 .nf
 .fi
-\fBpostconf\fR [\fB-dhnv\fR] [\fB-c \fIconfig_dir\fR]
+\fBpostconf\fR [\fB-dfhnv\fR] [\fB-c \fIconfig_dir\fR]
 [\fIparameter ...\fR]
 
-\fBpostconf\fR [\fB-aAmlv\fR] [\fB-c \fIconfig_dir\fR]
+\fBpostconf\fR [\fB-aAflmMv\fR] [\fB-c \fIconfig_dir\fR]
 
 \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
 [\fIparameter=value ...\fR]
@@ -24,7 +24,7 @@ Postfix configuration utility
 .SH DESCRIPTION
 .ad
 .fi
-The \fBpostconf\fR(1) command displays the values of
+The \fBpostconf\fR(1) command displays the values of \fBmain.cf\fR
 configuration parameters by default. It can also change
 parameter values, or display other configuration information
 about the Postfix mail system.
@@ -63,7 +63,7 @@ Display the message text that appears at the beginning of
 delivery status notification (DSN) messages, with $\fBname\fR
 expressions replaced by actual values.  To override the
 built-in message text, specify a template file at the end
-of the command line, or specify a template file in main.cf
+of the command line, or specify a template file in \fBmain.cf\fR
 with the \fBbounce_template_file\fR parameter.
 To force selection of the built-in message text templates,
 specify an empty template file name (in shell language: "").
@@ -73,7 +73,8 @@ This feature is available with Postfix 2.3 and later.
 The \fBmain.cf\fR configuration file is in the named directory
 instead of the default configuration directory.
 .IP \fB-d\fR
-Print default parameter settings instead of actual settings.
+Print \fBmain.cf\fR default parameter settings instead of
+actual settings.
 .IP \fB-e\fR
 Edit the \fBmain.cf\fR configuration file. The file is copied
 to a temporary file then renamed into place. Parameters and
@@ -82,9 +83,14 @@ to protect shell metacharacters and whitespace.
 
 With Postfix version 2.8 and later, the \fB-e\fR is no
 longer needed.
+.IP \fB-f\fR
+When printing \fBmain.cf\fR or \fBmaster.cf\fR configuration file
+entries, fold long lines for human readability.
+
+This feature is available with Postfix 2.9 and later.
 .IP \fB-h\fR
-Show parameter values only; do not prepend the "\fIname =
-\fR" label that normally precedes the value.
+Show \fBmain.cf\fR parameter values only; do not prepend
+the "\fIname = \fR" label that normally precedes the value.
 .IP \fB-l\fR
 List the names of all supported mailbox locking methods.
 Postfix supports the following methods:
@@ -183,14 +189,20 @@ The result is a group file entry in \fBgroup\fR(5) format.
 .RE
 .IP
 Other table types may exist depending on how Postfix was built.
+.IP \fB-M\fR
+Show \fBmaster.cf\fR file contents instead of \fBmain.cf\fR
+file contents.  Combine with \fB-f\fR to fold long lines
+for human readability.
+
+This feature is available with Postfix 2.9 and later.
 .IP \fB-n\fR
-Print parameter settings that are not left at their built-in
-default value, because they are explicitly specified in main.cf.
+Print \fBmain.cf\fR parameter settings that are explicitly
+specified in \fBmain.cf\fR.
 .IP "\fB-t\fR [\fItemplate_file\fR]"
 Display the templates for delivery status notification (DSN)
 messages. To override the built-in templates, specify a
 template file at the end of the command line, or specify a
-template file in main.cf with the \fBbounce_template_file\fR
+template file in \fBmain.cf\fR with the \fBbounce_template_file\fR
 parameter.  To force selection of the built-in templates,
 specify an empty template file name (in shell language:
 "").
index c2b6dee9e18cb853e98b023f8b526057e0060ed6..efb99f01ea7bfd3a04e1576b1fddf9d490a3a60f 100644 (file)
@@ -2465,6 +2465,11 @@ for authentication.  The available types are listed with the
 "\fBpostconf -A\fR" command.
 .PP
 This feature is available in Postfix 2.3 and later.
+.SH lmtp_send_dummy_mail_auth (default: no)
+The LMTP-specific version of the smtp_send_dummy_mail_auth
+configuration parameter.  See there for details.
+.PP
+This feature is available in Postfix 2.9 and later.
 .SH lmtp_send_xforward_command (default: no)
 Send an XFORWARD command to the LMTP server when the LMTP LHLO
 server response announces XFORWARD support.  This allows an \fBlmtp\fR(8)
@@ -6005,6 +6010,14 @@ for authentication.  The available types are listed with the
 "\fBpostconf -A\fR" command.
 .PP
 This feature is available in Postfix 2.3 and later.
+.SH smtp_send_dummy_mail_auth (default: no)
+Whether or not to append the "AUTH=<>" option to the MAIL
+FROM command in SASL-authenticated SMTP sessions. The default is
+not to send this, to avoid problems with broken remote SMTP servers.
+Before Postfix 2.9 the behavior is as if "smtp_send_dummy_mail_auth
+= yes".
+.PP
+This feature is available in Postfix 2.9 and later.
 .SH smtp_send_xforward_command (default: no)
 Send the non-standard XFORWARD command when the Postfix SMTP server
 EHLO response announces XFORWARD support.
@@ -8307,8 +8320,8 @@ no sender-specified routing (user@elsewhere@domain).
 code for rejected requests (default: 554).
 .IP "\fBreject_unknown_recipient_domain\fR"
 Reject the request when Postfix is not final destination for
-the recipient domain, and the RCPT TO domain has no DNS A or MX
-record, or when it has a malformed MX record such as a record with
+the recipient domain, and the RCPT TO domain has 1) no DNS A or MX
+record or 2) a malformed MX record such as a record with
 a zero-length MX hostname (Postfix version 2.3 and later).
 .br
 The
@@ -8749,8 +8762,8 @@ unauthenticated clients only. This feature is available in
 Postfix version 2.1 and later.
 .IP "\fBreject_unknown_sender_domain\fR"
 Reject the request when Postfix is not final destination for
-the sender address, and the MAIL FROM address has no DNS A or MX
-record, or when it has a malformed MX record such as a record with
+the sender address, and the MAIL FROM domain has 1) no DNS A or MX
+record, or 2) a malformed MX record such as a record with
 a zero-length MX hostname (Postfix version 2.3 and later).
 .br
 The
index 2c9fc267515c42911a6615f258b8f5ca8ea6ff79..89cb0ece4abe72763c31bd0e3c227426b5918226 100644 (file)
@@ -164,7 +164,7 @@ Always send EHLO at the start of an SMTP session.
 Never send EHLO at the start of an SMTP session.
 .IP "\fBsmtp_defer_if_no_mx_address_found (no)\fR"
 Defer mail delivery when no MX record resolves to an IP address.
-.IP "\fBsmtp_line_length_limit (990)\fR"
+.IP "\fBsmtp_line_length_limit (998)\fR"
 The maximal length of message header and body lines that Postfix
 will send via SMTP.
 .IP "\fBsmtp_pix_workaround_delay_time (10s)\fR"
@@ -263,6 +263,9 @@ Change the behavior of the smtp_*_timeout time limits, from a
 time limit per read or write system call, to a time limit to send
 or receive a complete record (an SMTP command line, SMTP response
 line, SMTP message content line, or TLS protocol message).
+.IP "\fBsmtp_send_dummy_mail_auth (no)\fR"
+Whether or not to append the "AUTH=<>" option to the MAIL
+FROM command in SASL-authenticated SMTP sessions.
 .SH "MIME PROCESSING CONTROLS"
 .na
 .nf
@@ -333,6 +336,11 @@ is removed.
 When a remote SMTP server rejects a SASL authentication request
 with a 535 reply code, defer mail delivery instead of returning
 mail as undeliverable.
+.PP
+Available in Postfix version 2.9 and later:
+.IP "\fBsmtp_send_dummy_mail_auth (no)\fR"
+Whether or not to append the "AUTH=<>" option to the MAIL
+FROM command in SASL-authenticated SMTP sessions.
 .SH "STARTTLS SUPPORT CONTROLS"
 .na
 .nf
index cbb5167b7d0f07e83bea7bdae4b9341c9f9a7c02..82c47044cc6456137475912b6469931b8918c839 100755 (executable)
@@ -410,6 +410,7 @@ while (<>) {
     s;\bsender_de[-</bB>]*\n* *[<bB>]*pendent_relay[-</bB>]*\n*[ <bB>]*host_maps\b;<a href="postconf.5.html#sender_dependent_relayhost_maps">$&</a>;g;
     s;\bempty_address_relayhost_maps_lookup_key\b;<a href="postconf.5.html#empty_address_relayhost_maps_lookup_key">$&</a>;g;
     s;\bsendmail_path\b;<a href="postconf.5.html#sendmail_path">$&</a>;g;
+    s;\bsendmail_fix_line_endings\b;<a href="postconf.5.html#sendmail_fix_line_endings">$&</a>;g;
     s;\bservice_throttle_time\b;<a href="postconf.5.html#service_throttle_time">$&</a>;g;
     s;\bsetgid_group\b;<a href="postconf.5.html#setgid_group">$&</a>;g;
 
@@ -632,6 +633,7 @@ while (<>) {
     s;\bsmtp_reply_filter\b;<a href="postconf.5.html#smtp_reply_filter">$&</a>;g;
     s;\bsmtp_address_preference\b;<a href="postconf.5.html#smtp_address_preference">$&</a>;g;
     s;\bsmtp_per_record_deadline\b;<a href="postconf.5.html#smtp_per_record_deadline">$&</a>;g;
+    s;\bsmtp_send_dummy_mail_auth\b;<a href="postconf.5.html#smtp_send_dummy_mail_auth">$&</a>;g;
     s;\bsmtpd_enforce_tls\b;<a href="postconf.5.html#smtpd_enforce_tls">$&</a>;g;
     s;\bsmtpd_sasl_tls_security_options\b;<a href="postconf.5.html#smtpd_sasl_tls_security_options">$&</a>;g;
     s;\bsmtpd_sasl_type\b;<a href="postconf.5.html#smtpd_sasl_type">$&</a>;g;
index e25f9c6b0dc18e6506697313c7f885907155835c..7b55f390af18d6432197bc7d415479c15f687c68 100644 (file)
@@ -5754,8 +5754,8 @@ code for rejected requests (default: 554). </dd>
 <dt><b><a name="reject_unknown_recipient_domain">reject_unknown_recipient_domain</a></b></dt>
 
 <dd>Reject the request when Postfix is not final destination for
-the recipient domain, and the RCPT TO domain has no DNS A or MX
-record, or when it has a malformed MX record such as a record with
+the recipient domain, and the RCPT TO domain has 1) no DNS A or MX
+record or 2) a malformed MX record such as a record with
 a zero-length MX hostname (Postfix version 2.3 and later). <br> The
 unknown_address_reject_code parameter specifies the numerical
 response code for rejected requests (default: 450).  The response
@@ -6128,8 +6128,8 @@ Postfix version 2.1 and later. </dd>
 <dt><b><a name="reject_unknown_sender_domain">reject_unknown_sender_domain</a></b></dt>
 
 <dd>Reject the request when Postfix is not final destination for
-the sender address, and the MAIL FROM address has no DNS A or MX
-record, or when it has a malformed MX record such as a record with
+the sender address, and the MAIL FROM domain has 1) no DNS A or MX
+record, or 2) a malformed MX record such as a record with
 a zero-length MX hostname (Postfix version 2.3 and later). <br> The
 unknown_address_reject_code parameter specifies the numerical
 response code for rejected requests (default: 450).  The response
@@ -14231,3 +14231,20 @@ Postfix 2.8 and earlier. </dd>
 </dl>
 
 <p> This feature is available in Postfix 2.9 and later. </p>
+
+%PARAM smtp_send_dummy_mail_auth no
+
+<p> Whether or not to append the "AUTH=&lt;&gt;" option to the MAIL
+FROM command in SASL-authenticated SMTP sessions. The default is
+not to send this, to avoid problems with broken remote SMTP servers.
+Before Postfix 2.9 the behavior is as if "smtp_send_dummy_mail_auth
+= yes".
+
+<p> This feature is available in Postfix 2.9 and later. </p>
+
+%PARAM lmtp_send_dummy_mail_auth no
+
+<p> The LMTP-specific version of the smtp_send_dummy_mail_auth
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.9 and later.  </p>
index ff2be2ebf9bbe0c886dc664205ae69a9b7c5dae9..d551df81e5c8f56982ad6ef01bf2eb7acdea67cb 100644 (file)
@@ -1603,6 +1603,10 @@ extern char *var_smtp_sasl_tls_opts;
 #define DEF_LMTP_SASL_TLSV_OPTS        "$" VAR_LMTP_SASL_TLS_OPTS
 extern char *var_smtp_sasl_tlsv_opts;
 
+#define VAR_SMTP_DUMMY_MAIL_AUTH       "smtp_send_dummy_mail_auth"
+#define DEF_SMTP_DUMMY_MAIL_AUTH       0
+extern bool var_smtp_dummy_mail_auth;
+
  /*
   * LMTP server. The soft error limit determines how many errors an LMTP
   * client may make before we start to slow down; the hard error limit
@@ -1670,6 +1674,10 @@ extern char *var_lmtp_sasl_opts;
 #define DEF_LMTP_SASL_PATH     ""
 extern char *var_lmtp_sasl_path;
 
+#define VAR_LMTP_DUMMY_MAIL_AUTH       "lmtp_send_dummy_mail_auth"
+#define DEF_LMTP_DUMMY_MAIL_AUTH       0
+extern bool var_lmtp_dummy_mail_auth;
+
  /*
   * SASL-based relay etc. control.
   */
index 75dfe5cb191b85742b25fb249226de4964b14d1b..6200634bbddd076a0a5006749f90bcda96f219a5 100644 (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      "20111025"
+#define MAIL_RELEASE_DATE      "20111106"
 #define MAIL_VERSION_NUMBER    "2.9"
 
 #ifdef SNAPSHOT
index 220c089e0273585a77f0bf37ba5f0dbb83f39bb9..a6716db8322bccc21072cc1bfe191ca0e542c5c0 100644 (file)
@@ -105,6 +105,7 @@ postconf.o: ../../include/msg_vstream.h
 postconf.o: ../../include/myflock.h
 postconf.o: ../../include/mymalloc.h
 postconf.o: ../../include/mynetworks.h
+postconf.o: ../../include/readlline.h
 postconf.o: ../../include/safe.h
 postconf.o: ../../include/split_at.h
 postconf.o: ../../include/stringops.h
index 6acedeff41ff714e8afa8a1d5349b259116ef591..e30ced0dcd5d6076a570a5db9eb8b0fc0d6cd767 100644 (file)
@@ -5,10 +5,10 @@
 /*     Postfix configuration utility
 /* SYNOPSIS
 /* .fi
-/*     \fBpostconf\fR [\fB-dhnv\fR] [\fB-c \fIconfig_dir\fR]
+/*     \fBpostconf\fR [\fB-dfhnv\fR] [\fB-c \fIconfig_dir\fR]
 /*     [\fIparameter ...\fR]
 /*
-/*     \fBpostconf\fR [\fB-aAmlv\fR] [\fB-c \fIconfig_dir\fR]
+/*     \fBpostconf\fR [\fB-aAflmMv\fR] [\fB-c \fIconfig_dir\fR]
 /*
 /*     \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
 /*     [\fIparameter=value ...\fR]
@@ -18,7 +18,7 @@
 /*
 /*     \fBpostconf\fR [\fB-btv\fR] [\fB-c \fIconfig_dir\fR] [\fItemplate_file\fR]
 /* DESCRIPTION
-/*     The \fBpostconf\fR(1) command displays the values of
+/*     The \fBpostconf\fR(1) command displays the values of \fBmain.cf\fR
 /*     configuration parameters by default. It can also change
 /*     parameter values, or display other configuration information
 /*     about the Postfix mail system.
@@ -57,7 +57,7 @@
 /*     delivery status notification (DSN) messages, with $\fBname\fR
 /*     expressions replaced by actual values.  To override the
 /*     built-in message text, specify a template file at the end
-/*     of the command line, or specify a template file in main.cf
+/*     of the command line, or specify a template file in \fBmain.cf\fR
 /*     with the \fBbounce_template_file\fR parameter.
 /*     To force selection of the built-in message text templates,
 /*     specify an empty template file name (in shell language: "").
@@ -67,7 +67,8 @@
 /*     The \fBmain.cf\fR configuration file is in the named directory
 /*     instead of the default configuration directory.
 /* .IP \fB-d\fR
-/*     Print default parameter settings instead of actual settings.
+/*     Print \fBmain.cf\fR default parameter settings instead of
+/*     actual settings.
 /* .IP \fB-e\fR
 /*     Edit the \fBmain.cf\fR configuration file. The file is copied
 /*     to a temporary file then renamed into place. Parameters and
 /*
 /*     With Postfix version 2.8 and later, the \fB-e\fR is no
 /*     longer needed.
+/* .IP \fB-f\fR
+/*     When printing \fBmain.cf\fR or \fBmaster.cf\fR configuration file
+/*     entries, fold long lines for human readability.
+/*
+/*     This feature is available with Postfix 2.9 and later.
 /* .IP \fB-h\fR
-/*     Show parameter values only; do not prepend the "\fIname =
-/*     \fR" label that normally precedes the value.
+/*     Show \fBmain.cf\fR parameter values only; do not prepend
+/*     the "\fIname = \fR" label that normally precedes the value.
 /* .IP \fB-l\fR
 /*     List the names of all supported mailbox locking methods.
 /*     Postfix supports the following methods:
 /* .RE
 /* .IP
 /*     Other table types may exist depending on how Postfix was built.
+/* .IP \fB-M\fR
+/*     Show \fBmaster.cf\fR file contents instead of \fBmain.cf\fR
+/*     file contents.  Combine with \fB-f\fR to fold long lines
+/*     for human readability.
+/*
+/*     This feature is available with Postfix 2.9 and later.
 /* .IP \fB-n\fR
-/*     Print parameter settings that are not left at their built-in
-/*     default value, because they are explicitly specified in main.cf.
+/*     Print \fBmain.cf\fR parameter settings that are explicitly
+/*     specified in \fBmain.cf\fR.
 /* .IP "\fB-t\fR [\fItemplate_file\fR]"
 /*     Display the templates for delivery status notification (DSN)
 /*     messages. To override the built-in templates, specify a
 /*     template file at the end of the command line, or specify a
-/*     template file in main.cf with the \fBbounce_template_file\fR
+/*     template file in \fBmain.cf\fR with the \fBbounce_template_file\fR
 /*     parameter.  To force selection of the built-in templates,
 /*     specify an empty template file name (in shell language:
 /*     "").
 #include <inet_proto.h>
 #include <argv.h>
 #include <edit_file.h>
+#include <readlline.h>
 
 /* Global library. */
 
 #define SHOW_MAPS      (1<<3)          /* show map types */
 #define EDIT_MAIN      (1<<4)          /* edit main.cf */
 #define SHOW_LOCKS     (1<<5)          /* show mailbox lock methods */
-#define SHOW_EVAL      (1<<6)          /* expand right-hand sides */
+#define SHOW_EVAL      (1<<6)          /* expand main.cf right-hand sides */
 #define SHOW_SASL_SERV (1<<7)          /* show server auth plugin types */
 #define SHOW_SASL_CLNT (1<<8)          /* show client auth plugin types */
 #define COMMENT_OUT    (1<<9)          /* #-out selected main.cf entries */
+#define SHOW_MASTER    (1<<10)         /* show master.cf entries */
+#define FOLD_LINE      (1<<11)         /* fold long *.cf entries */
 
  /*
   * Lookup table for in-core parameter info.
@@ -320,6 +335,11 @@ HTABLE *param_table;
   */
 DICT   *text_table;
 
+ /*
+  * Lookup table for master.cf info.
+  */
+ARGV  **master_table;
+
  /*
   * Declarations generated by scanning actual C source files.
   */
@@ -404,6 +424,14 @@ static const CONFIG_STR_FN_TABLE str_fn_table_2[] = {
     0,
 };
 
+ /*
+  * Line-wrapping support.
+  */
+#define LINE_LIMIT     80              /* try to fold longer lines */
+#define SEPARATORS     " \t\r\n"
+#define INDENT_LEN     4               /* indent long text by 4 */
+#define INDENT_TEXT    "    "
+
  /*
   * XXX Global so that call-backs can see it.
   */
@@ -730,6 +758,104 @@ static void hash_parameters(void)
        htable_enter(param_table, lst->name, (char *) lst);
 }
 
+/* read_master - read and digest the master.cf file */
+
+static void read_master(void)
+{
+    char   *path = concatenate(var_config_dir, "/", MASTER_CONF_FILE, (char *) 0);
+    VSTRING *buf = vstring_alloc(100);
+    ARGV   *argv;
+    VSTREAM *fp;
+    int     entry_count = 0;
+    int     line_count = 0;
+
+    /*
+     * We can't use the master_ent routines in their current form. They
+     * convert everything to internal form, and they skip disabled services.
+     * We need to be able to show default fields as "-", and we need to know
+     * about all service names so that we can generate dynamic parameter
+     * names (transport-dependent etc.).
+     */
+#define MASTER_BLANKS  " \t\r\n"               /* XXX */
+#define MASTER_FIELD_COUNT 8                   /* XXX */
+
+    /*
+     * Initialize the in-memory master table.
+     */
+    master_table = (ARGV **) mymalloc(sizeof(*master_table));
+
+    /*
+     * Skip blank lines and comment lines.
+     */
+    if ((fp = vstream_fopen(path, O_RDONLY, 0)) == 0)
+       msg_fatal("open %s: %m", path);
+    while (readlline(buf, fp, &line_count) != 0) {
+       master_table = (ARGV **) 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++] = argv;
+    }
+    master_table[entry_count] = 0;
+    vstream_fclose(fp);
+    myfree(path);
+    vstring_free(buf);
+}
+
+/* print_line - show line possibly folded, and with normalized whitespace */
+
+static void print_line(int mode, const char *fmt,...)
+{
+    va_list ap;
+    static VSTRING *buf = 0;
+    char   *start;
+    char   *next;
+    int     line_len = 0;
+    int     word_len;
+
+    /*
+     * One-off initialization.
+     */
+    if (buf == 0)
+       buf = vstring_alloc(100);
+
+    /*
+     * Format the text.
+     */
+    va_start(ap, fmt);
+    vstring_vsprintf(buf, fmt, ap);
+    va_end(ap);
+
+    /*
+     * Normalize the whitespace. We don't use the line_wrap() routine because
+     * 1) that function does not normalize whitespace between words and 2) we
+     * want to normalize whitespace even when not wrapping lines.
+     * 
+     * XXX Some parameters preserve whitespace: for example, smtpd_banner and
+     * smtpd_reject_footer. If we have to preserve whitespace between words,
+     * then perhaps readlline() can be changed to canonicalize whitespace
+     * that follows a newline.
+     */
+    for (start = STR(buf); *(start += strspn(start, SEPARATORS)) != 0; start = next) {
+       word_len = strcspn(start, SEPARATORS);
+       if (*(next = start + word_len) != 0)
+           *next++ = 0;
+       if (word_len > 0 && line_len > 0) {
+           if ((mode & FOLD_LINE) == 0 || line_len + word_len < LINE_LIMIT) {
+               vstream_fputs(" ", VSTREAM_OUT);
+               line_len += 1;
+           } else {
+               vstream_fputs("\n" INDENT_TEXT, VSTREAM_OUT);
+               line_len = INDENT_LEN;
+           }
+       }
+       vstream_fputs(start, VSTREAM_OUT);
+       line_len += word_len;
+    }
+    vstream_fputs("\n", VSTREAM_OUT);
+}
+
 /* show_strval - show string-valued parameter */
 
 static void show_strval(int mode, const char *name, const char *value)
@@ -738,9 +864,9 @@ static void show_strval(int mode, const char *name, const char *value)
        value = mail_conf_eval(value);
 
     if (mode & SHOW_NAME) {
-       vstream_printf("%s = %s\n", name, value);
+       print_line(mode, "%s = %s\n", name, value);
     } else {
-       vstream_printf("%s\n", value);
+       print_line(mode, "%s\n", value);
     }
 }
 
@@ -749,9 +875,9 @@ static void show_strval(int mode, const char *name, const char *value)
 static void show_intval(int mode, const char *name, int value)
 {
     if (mode & SHOW_NAME) {
-       vstream_printf("%s = %d\n", name, value);
+       print_line(mode, "%s = %d\n", name, value);
     } else {
-       vstream_printf("%d\n", value);
+       print_line(mode, "%d\n", value);
     }
 }
 
@@ -760,9 +886,9 @@ static void show_intval(int mode, const char *name, int value)
 static void show_longval(int mode, const char *name, long value)
 {
     if (mode & SHOW_NAME) {
-       vstream_printf("%s = %ld\n", name, value);
+       print_line(mode, "%s = %ld\n", name, value);
     } else {
-       vstream_printf("%ld\n", value);
+       print_line(mode, "%ld\n", value);
     }
 }
 
@@ -906,7 +1032,7 @@ static void print_str_fn_2(int mode, CONFIG_STR_FN_TABLE *csft)
 
 /* print_raw - print raw string parameter */
 
-static void print_raw(int mode, CONFIG_RAW_TABLE * rst)
+static void print_raw(int mode, CONFIG_RAW_TABLE *rst)
 {
     const char *value;
 
@@ -933,7 +1059,7 @@ static void print_raw(int mode, CONFIG_RAW_TABLE * rst)
 
 /* print_nint - print new integer parameter */
 
-static void print_nint(int mode, CONFIG_NINT_TABLE * rst)
+static void print_nint(int mode, CONFIG_NINT_TABLE *rst)
 {
     const char *value;
 
@@ -960,7 +1086,7 @@ static void print_nint(int mode, CONFIG_NINT_TABLE * rst)
 
 /* print_nbool - print new boolean parameter */
 
-static void print_nbool(int mode, CONFIG_NBOOL_TABLE * bst)
+static void print_nbool(int mode, CONFIG_NBOOL_TABLE *bst)
 {
     const char *value;
 
@@ -1078,6 +1204,107 @@ static void show_locks(void)
     argv_free(locks_argv);
 }
 
+/* show_master - show master.cf entries */
+
+static void show_master(int mode)
+{
+    ARGV  **argvp;
+    ARGV   *argv;
+    char   *arg;
+    char   *aval;
+    int     line_len;
+    int     field;
+    int     in_daemon_options;
+    static int column_goal[] = {
+       0,                              /* service */
+       11,                             /* type */
+       17,                             /* private */
+       25,                             /* unpriv */
+       33,                             /* chroot */
+       41,                             /* wakeup */
+       49,                             /* maxproc */
+       57,                             /* command */
+    };
+
+#define ADD_TEXT(text, len) do { \
+       vstream_fputs(text, VSTREAM_OUT); line_len += len; } \
+    while (0)
+#define ADD_SPACE ADD_TEXT(" ", 1)
+
+    for (argvp = master_table; (argv = *argvp) != 0; argvp++) {
+
+       /*
+        * Show the standard fields at their preferred column position. Use
+        * single-space separation when some field does not fit.
+        */
+       for (line_len = 0, field = 0; field < MASTER_FIELD_COUNT; field++) {
+           arg = argv->argv[field];
+           if (line_len > 0) {
+               while (line_len < column_goal[field] - 1)
+                   ADD_SPACE;
+               ADD_SPACE;
+           }
+           ADD_TEXT(arg, strlen(arg));
+       }
+
+       /*
+        * 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.
+        */
+       in_daemon_options = 1;
+       for ( /* void */ ; argv->argv[field] != 0; field++) {
+           arg = argv->argv[field];
+           if (in_daemon_options) {
+
+               /*
+                * Try to show the generic options (-v -D) on the first line,
+                * and non-options on a later line.
+                */
+               if (arg[0] != '-') {
+                   in_daemon_options = 0;
+                   if ((mode & FOLD_LINE)
+                       && line_len > column_goal[MASTER_FIELD_COUNT - 1]) {
+                       vstream_fputs("\n" INDENT_TEXT, VSTREAM_OUT);
+                       line_len = INDENT_LEN;
+                   }
+               }
+
+               /*
+                * Try to avoid breaking "-o name=value" over multiple lines
+                * if it would fit on one line.
+                */
+               else if ((mode & FOLD_LINE)
+                        && line_len > INDENT_LEN && strcmp(arg, "-o") == 0
+                        && (aval = argv->argv[field + 1]) != 0
+                        && INDENT_LEN + 3 + strlen(aval) < LINE_LIMIT) {
+                   vstream_fputs("\n" INDENT_TEXT, VSTREAM_OUT);
+                   line_len = INDENT_LEN;
+                   ADD_TEXT(arg, strlen(arg));
+                   arg = aval;
+                   field += 1;
+               }
+           }
+
+           /*
+            * Insert a line break when the next argument won't fit (unless,
+            * of course, we just inserted a line break).
+            */
+           if (line_len > INDENT_LEN) {
+               if ((mode & FOLD_LINE) == 0
+                   || line_len + 1 + strlen(arg) < LINE_LIMIT) {
+                   ADD_SPACE;
+               } else {
+                   vstream_fputs("\n" INDENT_TEXT, VSTREAM_OUT);
+                   line_len = INDENT_LEN;
+               }
+           }
+           ADD_TEXT(arg, strlen(arg));
+       }
+       vstream_fputs("\n", VSTREAM_OUT);
+    }
+}
+
 /* show_sasl - show SASL plug-in types */
 
 static void show_sasl(int what)
@@ -1165,7 +1392,7 @@ int     main(int argc, char **argv)
     /*
      * Parse JCL.
      */
-    while ((ch = GETOPT(argc, argv, "aAbc:deE#hmlntv")) > 0) {
+    while ((ch = GETOPT(argc, argv, "aAbc:deEf#hlmMntv")) > 0) {
        switch (ch) {
        case 'a':
            cmd_mode |= SHOW_SASL_SERV;
@@ -1189,6 +1416,9 @@ int     main(int argc, char **argv)
        case 'e':
            cmd_mode |= EDIT_MAIN;
            break;
+       case 'f':
+           cmd_mode |= FOLD_LINE;
+           break;
 
            /*
             * People, this does not work unless you properly handle default
@@ -1214,6 +1444,9 @@ int     main(int argc, char **argv)
        case 'm':
            cmd_mode |= SHOW_MAPS;
            break;
+       case 'M':
+           cmd_mode |= SHOW_MASTER;
+           break;
        case 'n':
            cmd_mode |= SHOW_NONDEF;
            break;
@@ -1227,20 +1460,20 @@ int     main(int argc, char **argv)
            msg_verbose++;
            break;
        default:
-           msg_fatal("usage: %s [-a (server SASL types)] [-A (client SASL types)] [-b (bounce templates)] [-c config_dir] [-d (defaults)] [-e (edit)] [-# (comment-out)] [-h (no names)] [-l (lock types)] [-m (map types)] [-n (non-defaults)] [-v] [name...]", argv[0]);
+           msg_fatal("usage: %s [-a (server SASL types)] [-A (client SASL types)] [-b (bounce templates)] [-c config_dir] [-d (defaults)] [-e (edit)] [-f (fold lines)] [-# (comment-out)] [-h (no names)] [-l (lock types)] [-m (map types)] [-M (master.cf)] [-n (non-defaults)] [-v] [name...]", argv[0]);
        }
     }
 
     /*
      * Sanity check.
      */
-    junk = (cmd_mode & (SHOW_DEFS | SHOW_NONDEF | SHOW_MAPS | SHOW_LOCKS | EDIT_MAIN | SHOW_SASL_SERV | SHOW_SASL_CLNT | COMMENT_OUT));
+    junk = (cmd_mode & (SHOW_DEFS | SHOW_NONDEF | SHOW_MAPS | SHOW_LOCKS | EDIT_MAIN | SHOW_SASL_SERV | SHOW_SASL_CLNT | COMMENT_OUT | SHOW_MASTER));
     if (junk != 0 && ((junk != SHOW_DEFS && junk != SHOW_NONDEF
             && junk != SHOW_MAPS && junk != SHOW_LOCKS && junk != EDIT_MAIN
                       && junk != SHOW_SASL_SERV && junk != SHOW_SASL_CLNT
-                      && junk != COMMENT_OUT)
+                      && junk != COMMENT_OUT && junk != SHOW_MASTER)
                      || ext_argv != 0))
-       msg_fatal("specify one of -a, -A, -b, -d, -e, -#, -m, -l and -n");
+       msg_fatal("specify one of -a, -A, -b, -d, -e, -#, -l, -m, -M and -n");
 
     /*
      * Display bounce template information and exit.
@@ -1278,6 +1511,15 @@ int     main(int argc, char **argv)
        show_locks();
     }
 
+    /*
+     * If showing master.cf entries, show them and exit
+     */
+    else if (cmd_mode & SHOW_MASTER) {
+       mail_conf_read();
+       read_master();
+       show_master(cmd_mode);
+    }
+
     /*
      * If showing SASL plug-in types, show them and exit
      */
index 3a190f7c354fbbcc5ca81d5e94ed8ae613d95637..dda8f354423909859e916420dee016a43f6ec226 100644 (file)
@@ -81,7 +81,7 @@ typedef struct {
 #define PSC_STATE_FLAG_NEW             (1<<3)  /* some test was never passed */
 #define PSC_STATE_FLAG_BLIST_FAIL      (1<<4)  /* blacklisted */
 #define PSC_STATE_FLAG_HANGUP          (1<<5)  /* NOT a test failure */
-#define PSC_STATE_FLAG_SMTPD_421       (1<<6)  /* hang up after command */
+#define PSC_STATE_FLAG_SMTPD_X21       (1<<6)  /* hang up after command */
 #define PSC_STATE_FLAG_WLIST_FAIL      (1<<7)  /* do not whitelist */
 
  /*
@@ -435,8 +435,8 @@ extern void psc_smtpd_tests(PSC_STATE *);
 extern void psc_smtpd_init(void);
 extern void psc_smtpd_pre_jail_init(void);
 
-#define PSC_SMTPD_421(state, reply) do { \
-       (state)->flags |= PSC_STATE_FLAG_SMTPD_421; \
+#define PSC_SMTPD_X21(state, reply) do { \
+       (state)->flags |= PSC_STATE_FLAG_SMTPD_X21; \
        (state)->final_reply = (reply); \
        psc_smtpd_tests(state); \
     } while (0)
index bb111965e0881dc3f32c70958186941df7a64bb0..cbbbf97c7f08743ef2056336f8970a058b6dbb1e 100644 (file)
 /*     work is finished including postscreen cache updates.
 /*
 /*     In case of an immediate error, psc_send_socket() sends a 421
-/*     reply to the remote SMTP client and closes the connection
-/*     if no partial SMTP greeting was sent. Otherwise, it redirects
-/*     the SMTP client to the dummy protocol engine which sends
-/*     421 at the first legitimate opportunity and hangs up.
+/*     reply to the remote SMTP client and closes the connection.
+/*     If the 220- greeting was sent, sending 421 would be invalid;
+/*     instead, the client is redirected to the dummy SMTP engine
+/*     which sends the 421 reply at the first legitimate opportunity.
 /* LICENSE
 /* .ad
 /* .fi
@@ -185,18 +185,13 @@ void    psc_send_socket(PSC_STATE *state)
      * suspicious. Alternatively, we could send attributes along with the
      * socket with client reputation information, making everything even more
      * Postfix-specific.
-     * 
-     * If the operation fails after the partial SMTP handshake was sent,
-     * redirect the client to the dummy SMTP engine, which finishes the
-     * partial SMTP handshake sends the bad news after the first client
-     * command.
      */
     if ((server_fd =
         PASS_CONNECT(psc_smtpd_service_name, NON_BLOCKING,
                      PSC_SEND_SOCK_CONNECT_TIMEOUT)) < 0) {
        msg_warn("cannot connect to service %s: %m", psc_smtpd_service_name);
        if (state->flags & PSC_STATE_FLAG_PREGR_TODO) {
-           PSC_SMTPD_421(state, "421 4.3.2 No system resources\r\n");
+           PSC_SMTPD_X21(state, "421 4.3.2 No system resources\r\n");
        } else {
            PSC_SEND_REPLY(state, "421 4.3.2 All server ports are busy\r\n");
            psc_free_session_state(state);
@@ -209,7 +204,7 @@ void    psc_send_socket(PSC_STATE *state)
                 psc_smtpd_service_name);
        (void) close(server_fd);
        if (state->flags & PSC_STATE_FLAG_PREGR_TODO) {
-           PSC_SMTPD_421(state, "421 4.3.2 No system resources\r\n");
+           PSC_SMTPD_X21(state, "421 4.3.2 No system resources\r\n");
        } else {
            PSC_SEND_REPLY(state, "421 4.3.2 No system resources\r\n");
            psc_free_session_state(state);
index 67db377f570637592c9fee0c1ddb6f4c16045f2f..3eae5a5857a9926b6986cb70afbd7a4edfc387bd 100644 (file)
@@ -13,7 +13,7 @@
 /*     void    psc_smtpd_tests(state)
 /*     PSC_STATE *state;
 /*
-/*     void    PSC_SMTPD_421(state, final_reply)
+/*     void    PSC_SMTPD_X21(state, final_reply)
 /*     PSC_STATE *state;
 /*     const char *final_reply;
 /* DESCRIPTION
 /*     protocol tests and for collecting helo/sender/recipient
 /*     information.
 /*
-/*     PSC_SMTPD_421() redirects the SMTP client to the dummy SMTP
-/*     protocol engine, completes the SMTP protocol handshake,
-/*     sends the specified final reply after the first non-QUIT
-/*     client command, and hangs up without doing any protocol
-/*     tests.  The final reply must end in <CR><LF>.
+/*     PSC_SMTPD_X21() redirects the SMTP client to an SMTP server
+/*     engine, which sends the specified final reply at the first
+/*     legitimate opportunity without doing any protocol tests.
 /*
 /*     Unlike the Postfix SMTP server, this engine does not announce
 /*     PIPELINING support. This exposes spambots that pipeline
@@ -914,7 +912,7 @@ static void psc_smtpd_read_event(int event, char *context)
            if (strcasecmp(command, cmdp->name) == 0)
                break;
 
-       if ((state->flags & PSC_STATE_FLAG_SMTPD_421)
+       if ((state->flags & PSC_STATE_FLAG_SMTPD_X21)
            && cmdp->action != psc_quit_cmd) {
            PSC_CLEAR_EVENT_DROP_SESSION_STATE(state, psc_smtpd_time_event,
                                               state->final_reply);
@@ -1104,10 +1102,11 @@ void    psc_smtpd_tests(PSC_STATE *state)
      * 
      * XXX Make "opportunistically" configurable for each test.
      */
-    if ((state->flags & PSC_STATE_FLAG_SMTPD_421) == 0)
-       state->flags |= (PSC_STATE_FLAG_PIPEL_TODO | \
-                        PSC_STATE_FLAG_NSMTP_TODO | \
-                        PSC_STATE_FLAG_BARLF_TODO);
+    if ((state->flags & PSC_STATE_FLAG_SMTPD_X21) == 0) {
+       state->flags |= PSC_STATE_MASK_SMTPD_TODO;
+    } else {
+       state->flags &= ~PSC_STATE_MASK_SMTPD_TODO;
+    }
 
     /*
      * Send no SMTP banner to pregreeting clients. This eliminates a lot of
index 3ec0c625c7b5df77eace90cc362f45571e6e5b8a..58d9dfd02be542eaf6b740522ac6e0d22cf3d49f 100644 (file)
        VAR_LMTP_SASL_AUTH_SOFT_BOUNCE, DEF_LMTP_SASL_AUTH_SOFT_BOUNCE, &var_smtp_sasl_auth_soft_bounce,
        VAR_LMTP_ASSUME_FINAL, DEF_LMTP_ASSUME_FINAL, &var_lmtp_assume_final,
        VAR_LMTP_REC_DEADLINE, DEF_LMTP_REC_DEADLINE, &var_smtp_rec_deadline,
+       VAR_LMTP_DUMMY_MAIL_AUTH, DEF_LMTP_DUMMY_MAIL_AUTH, &var_smtp_dummy_mail_auth,
        0,
     };
index 7cbee76de658d05688e099ff50639014064f5054..6d1c3c93c7151b1f7a21d08ca3527573904c0eb3 100644 (file)
 /*     Never send EHLO at the start of an SMTP session.
 /* .IP "\fBsmtp_defer_if_no_mx_address_found (no)\fR"
 /*     Defer mail delivery when no MX record resolves to an IP address.
-/* .IP "\fBsmtp_line_length_limit (990)\fR"
+/* .IP "\fBsmtp_line_length_limit (998)\fR"
 /*     The maximal length of message header and body lines that Postfix
 /*     will send via SMTP.
 /* .IP "\fBsmtp_pix_workaround_delay_time (10s)\fR"
 /*     time limit per read or write system call, to a time limit to send
 /*     or receive a complete record (an SMTP command line, SMTP response
 /*     line, SMTP message content line, or TLS protocol message).
+/* .IP "\fBsmtp_send_dummy_mail_auth (no)\fR"
+/*     Whether or not to append the "AUTH=<>" option to the MAIL
+/*     FROM command in SASL-authenticated SMTP sessions.
 /* MIME PROCESSING CONTROLS
 /* .ad
 /* .fi
 /*     When a remote SMTP server rejects a SASL authentication request
 /*     with a 535 reply code, defer mail delivery instead of returning
 /*     mail as undeliverable.
+/* .PP
+/*     Available in Postfix version 2.9 and later:
+/* .IP "\fBsmtp_send_dummy_mail_auth (no)\fR"
+/*     Whether or not to append the "AUTH=<>" option to the MAIL
+/*     FROM command in SASL-authenticated SMTP sessions.
 /* STARTTLS SUPPORT CONTROLS
 /* .ad
 /* .fi
@@ -830,6 +838,7 @@ char   *var_smtp_resp_filter;
 bool    var_lmtp_assume_final;
 char   *var_smtp_dns_res_opt;
 bool    var_smtp_rec_deadline;
+bool    var_smtp_dummy_mail_auth;
 
  /* Special handling of 535 AUTH errors. */
 char   *var_smtp_sasl_auth_cache_name;
index b23b03a101d16658b5271848e1db8c4bba774684..193894e6485f50b0e503f78031a2522cbf987508 100644 (file)
        VAR_SMTP_SASL_AUTH_SOFT_BOUNCE, DEF_SMTP_SASL_AUTH_SOFT_BOUNCE, &var_smtp_sasl_auth_soft_bounce,
        VAR_LMTP_ASSUME_FINAL, DEF_LMTP_ASSUME_FINAL, &var_lmtp_assume_final,
        VAR_SMTP_REC_DEADLINE, DEF_SMTP_REC_DEADLINE, &var_smtp_rec_deadline,
+       VAR_SMTP_DUMMY_MAIL_AUTH, DEF_SMTP_DUMMY_MAIL_AUTH, &var_smtp_dummy_mail_auth,
        0,
     };
index 0ce010263c65aa73dd4b72164e50b2fcfa2a1a1d..ae32f0a2b915c923e5a8fe5a5ef453aba9757c73 100644 (file)
@@ -1356,6 +1356,7 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
             */
 #ifdef USE_SASL_AUTH
            if (var_smtp_sasl_enable
+               && var_smtp_dummy_mail_auth
                && (session->features & SMTP_FEATURE_AUTH))
                vstring_strcat(next_command, " AUTH=<>");
 #endif
index 60750cc2d97b7ee569eb7413f764b1f8d085ad02..bcdbefdc080242fb273250237ea5bac5b56004b9 100644 (file)
@@ -616,6 +616,7 @@ static void ehlo_response(SINK_STATE *state, const char *args)
        smtp_printf(state->stream, "250-XFORWARD NAME ADDR PROTO HELO");
     if (!disable_enh_status)
        smtp_printf(state->stream, "250-ENHANCEDSTATUSCODES");
+    /* RFC 821/2821/5321: Format is replycode<SPACE>optional-text<CRLF> */
     smtp_printf(state->stream, "250 ");
     smtp_flush(state->stream);
     if (single_template) {
index fb010eed6bd568548b31ab584d0c26781f8d3e18..0f12d203c77824a5228f2933c89206397d213fc9 100644 (file)
 /*     const char *VSTREAM_PATH(stream)
 /*     VSTREAM *stream;
 /*
-/*     char    *vstream_vfprintf(vp, format, ap)
+/*     char    *vstream_vprintf(format, ap)
+/*     const char *format;
+/*     va_list *ap;
+/*
+/*     char    *vstream_vfprintf(stream, format, ap)
+/*     VSTREAM *stream;
 /*     const char *format;
 /*     va_list *ap;
 /*
 /*     vstream_vfprintf() provides an alternate interface
 /*     for formatting an argument list according to a format string.
 /*
+/*     vstream_vprintf() provides a similar alternative interface.
+/*
 /*     vstream_bufstat() provides input and output buffer status
 /*     information.  The command is one of the following:
 /* .IP VSTREAM_BST_IN_PEND
@@ -1487,6 +1494,16 @@ void    vstream_control(VSTREAM *stream, int name,...)
     va_end(ap);
 }
 
+/* vstream_vprintf - formatted print to stdout */
+
+VSTREAM *vstream_vprintf(const char *format, va_list ap)
+{
+    VSTREAM *vp = VSTREAM_OUT;
+
+    vbuf_print(&vp->buf, format, ap);
+    return (vp);
+}
+
 /* vstream_vfprintf - formatted print engine */
 
 VSTREAM *vstream_vfprintf(VSTREAM *vp, const char *format, va_list ap)
index 907b26e7e4d2df407960f8cfa36780a613ad6017..ddb8fda6a0aa5e7b2f809fda9b9e7b5ac4b8835a 100644 (file)
@@ -167,6 +167,7 @@ extern int vstream_pclose(VSTREAM *);
 #define VSTREAM_POPEN_WAITPID_FN 7     /* child catcher, waitpid() compat. */
 #define VSTREAM_POPEN_EXPORT   8       /* exportable environment */
 
+extern VSTREAM *vstream_vprintf(const char *, va_list);
 extern VSTREAM *vstream_vfprintf(VSTREAM *, const char *, va_list);
 
 extern ssize_t vstream_peek(VSTREAM *);