]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.9-20111118
authorWietse Venema <wietse@porcupine.org>
Fri, 18 Nov 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:37:36 +0000 (06:37 +0000)
16 files changed:
postfix/HISTORY
postfix/README_FILES/SASL_README
postfix/RELEASE_NOTES
postfix/WISHLIST
postfix/html/SASL_README.html
postfix/html/postconf.1.html
postfix/man/man1/postconf.1
postfix/proto/SASL_README.html
postfix/src/global/mail_version.h
postfix/src/global/match_service.c
postfix/src/global/match_service.h
postfix/src/postconf/Makefile.in
postfix/src/postconf/postconf.c
postfix/src/postconf/test10.ref [new file with mode: 0644]
postfix/src/postconf/test11.ref [new file with mode: 0644]
postfix/src/postconf/test9.ref [new file with mode: 0644]

index 31a3b66c57efa1dcfcf94ecd6d4b9ba9d4db4497..083a15081cb4e14837e93f1b6d73b4567068f904 100644 (file)
@@ -17089,6 +17089,17 @@ Apologies for any names omitted.
        Workaround: don't abort when IPv6 is present but busted.
        File: util/inet_proto.c.
 
-       Portability: Dovecot now officially supports more socket
-       types for its authentication server. File:
+       Portability: the Dovecot 2.0 authentication server supports
+       more socket types for its authentication server. File:
        xsasl/xsasl_dovecot_server.c.
+
+       Documentation: the Dovecot 2.0 authentication server supports
+       communication over TCP sockets. Patrick Ben Koetter.  File:
+       proto/SASL_README.html.
+
+20111118
+
+       Cleanup: "postconf -M" now supports filtering. For example,
+       "postconf -M inet" shows only services that listen on the
+       network, and "postconf -M smtp.unix" shows the SMTP delivery
+       agent. File: postconf.c.
index 54c9fb352d35e1e87d73869c518a5b809f1148d6..77dd9f2e21a00cf9a7745f7d5279151c7375d771 100644 (file)
@@ -108,8 +108,13 @@ configure and operate the Dovecot authentication server.
 P\bPo\bos\bst\btf\bfi\bix\bx t\bto\bo D\bDo\bov\bve\bec\bco\bot\bt S\bSA\bAS\bSL\bL c\bco\bom\bmm\bmu\bun\bni\bic\bca\bat\bti\bio\bon\bn
 
 Communication between the Postfix SMTP server and Dovecot SASL happens via a
-UNIX-domain socket. The socket pathname and the list of mechanisms offered to
-Postfix need to be specified on the Dovecot server side in dovecot.conf.
+UNIX-domain socket. Additionally, when using Dovecot version 2.0 and later,
+communication can take place over a TCP socket.
+
+U\bUN\bNI\bIX\bX-\b-d\bdo\bom\bma\bai\bin\bn s\bso\boc\bck\bke\bet\bt c\bco\bom\bmm\bmu\bun\bni\bic\bca\bat\bti\bio\bon\bn
+
+The socket pathname and the list of mechanisms offered to Postfix need to be
+specified on the Dovecot server side in dovecot.conf.
 
 The following example assumes that the Postfix queue is under /var/spool/
 postfix/.
@@ -138,6 +143,34 @@ Line 3 provides plain and login as mechanisms for the Postfix SMTP server, line
 Proceed with the section "Enabling SASL authentication and authorization in the
 Postfix SMTP server" to turn on and use SASL in the Postfix SMTP server.
 
+T\bTC\bCP\bP s\bso\boc\bck\bke\bet\bt c\bco\bom\bmm\bmu\bun\bni\bic\bca\bat\bti\bio\bon\bn
+
+The TCP port and the list of mechanisms offered to Postfix need to be specified
+on the Dovecot server side in 10-auth.conf and 10-master.conf.
+
+The following examples assume that Postfix should communicate with Dovecot on
+TCP port 12345.
+
+    1 /etc/dovecot/conf.d/10-auth.conf:
+    2     auth_mechanisms = plain login
+
+Line 2 provides plain and login as mechanisms for the Postfix SMTP server.
+
+    1 /etc/dovecot/conf.d/10-master.conf:
+    2     service auth {
+    3       unix_listener auth-userdb {
+    4       }
+    5       inet_listener {
+    6         port = 12345
+    7       }
+    8     }
+
+Line 5 creates a new TCP socket and line 6 specifies port 12345 where Dovecot
+SASL should wait for Postfix authentication requests.
+
+Proceed with the section "Enabling SASL authentication and authorization in the
+Postfix SMTP server" to turn on and use SASL in the Postfix SMTP server.
+
 C\bCo\bon\bnf\bfi\big\bgu\bur\bri\bin\bng\bg C\bCy\byr\bru\bus\bs S\bSA\bAS\bSL\bL
 
 The Cyrus SASL framework supports a wide variety of applications (POP, IMAP,
@@ -646,17 +679,27 @@ dovecot instead of cyrus:
     /etc/postfix/main.cf:
         smtpd_sasl_type = dovecot
 
-Additionally set the path where the Postfix SMTP server can find the Dovecot
-SASL socket:
+Additionally specify how Postfix SMTP server can find the Dovecot
+authentication server. This depends on the settings that you have selected in
+the section "Postfix to Dovecot SASL communication".
+
+  * If you configured Dovecot for UNIX-domain socket communication, configure
+    Postfix as follows:
 
     /etc/postfix/main.cf:
         smtpd_sasl_path = private/auth
 
     N\bNo\bot\bte\be
-
     This example uses a pathname relative to the Postfix queue directory, so
     that it will work whether or not the Postfix SMTP server runs chrooted.
 
+  * If you configured Dovecot for TCP socket communication, configure Postfix
+    as follows (if Dovecot runs on a different machine, replace 127.0.0.1 by
+    that machine's IP address):
+
+    /etc/postfix/main.cf:
+        smtpd_sasl_path = inet:127.0.0.1:12345
+
 E\bEn\bna\bab\bbl\bli\bin\bng\bg S\bSA\bAS\bSL\bL a\bau\but\bth\bhe\ben\bnt\bti\bic\bca\bat\bti\bio\bon\bn i\bin\bn t\bth\bhe\be P\bPo\bos\bst\btf\bfi\bix\bx S\bSM\bMT\bTP\bP s\bse\ber\brv\bve\ber\br
 
 Regardless of the SASL implementation type, enabling SMTP authentication in the
index 101b24f4b014f5213746490896a606c64d444086..6e8ce5ad17af15361bf4c6073d0c1a72aba24722 100644 (file)
@@ -14,6 +14,13 @@ 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.
 
+Major changes with snapshot 20111118
+====================================
+
+The "postconf -M" (display master.cf) command now supports filtering.
+For example, specify "postconf -M inet" to display only services
+that listen on the network.
+
 Incompatible changes with snapshot 20111113
 ===========================================
 
index aa9f7c5b267b0e367bb166eaa9700f5708fa01fd..4157fa95582f8c1a9b082f23300e10da9ed0937f 100644 (file)
@@ -6,10 +6,6 @@ Wish list:
 
        Things to do after the stable release:
 
-       postconf: add test cases for unused name=value entries in
-       main.cf and master.cf; add support for per-service parameter
-       name spaces in master.cf.
-
        TLS_README has the priorities reversed. The section about
        SMTP client settings begins with an exposition about client
        certificates, which almost no-one needs. Instead, the text
index cc75f7bc2e09b213268aff4829f6812a51e32571..eac6449194862ac213462a3496d710a36c5ccddf 100644 (file)
@@ -185,7 +185,13 @@ to configure and operate the Dovecot authentication server.  </p>
 <h4><a name="server_dovecot_comm">Postfix to Dovecot SASL communication</a></h4>
 
 <p> Communication between the Postfix SMTP server
-and Dovecot SASL happens via a UNIX-domain socket.  The socket
+and Dovecot SASL happens via a UNIX-domain socket.  Additionally,
+when using Dovecot version 2.0 and later, communication can take
+place over a TCP socket.
+
+<h5>UNIX-domain socket communication</h5>
+
+<p> The socket
 pathname and the list of mechanisms offered to Postfix need to be
 specified on the Dovecot server side in <code>dovecot.conf</code>.
 </p>
@@ -224,6 +230,46 @@ lines 11-13 limit read+write permissions to user and group
 SASL authentication and authorization in the Postfix SMTP server</a>"
 to turn on and use SASL in the Postfix SMTP server.  </p>
 
+<h5>TCP socket communication</h5>
+
+<p> The TCP port and the list of mechanisms offered to Postfix need
+to be specified on the Dovecot server side in <code>10-auth.conf</code>
+and <code>10-master.conf</code>. </p>
+
+<p> The following examples assume that Postfix should communicate
+with Dovecot on TCP port 12345. </p>
+
+<blockquote>
+<pre>
+1 /etc/dovecot/conf.d/10-auth.conf:
+2     auth_mechanisms = plain login
+</pre>
+</blockquote>
+
+<p> Line 2 provides plain and login as mechanisms for the Postfix
+SMTP server. </p>
+
+<blockquote>
+<pre>
+1 /etc/dovecot/conf.d/10-master.conf:
+2     service auth {
+3       unix_listener auth-userdb {
+4       }
+5       inet_listener {
+6         port = 12345
+7       }
+8     }
+</pre>
+</blockquote>
+
+<p> Line 5 creates a new TCP socket and line 6 specifies port 12345
+where Dovecot SASL should wait for Postfix authentication requests.
+</p>
+
+<p> Proceed with the section "<a href="#server_sasl_enable">Enabling
+SASL authentication and authorization in the Postfix SMTP server</a>"
+to turn on and use SASL in the Postfix SMTP server.  </p>
+
 <h3><a name="server_cyrus">Configuring Cyrus SASL</a></h3>
 
 <p> The Cyrus SASL framework supports a wide variety of applications
@@ -1098,17 +1144,20 @@ instead of <code>cyrus</code>: </p>
 </pre>
 </blockquote>
 
-<p> Additionally set the path where the Postfix SMTP server can
-find the Dovecot SASL socket: </p>
+<p> Additionally specify how Postfix SMTP server can find the Dovecot
+authentication server. This depends on the settings that you have
+selected in the section "<a href="#server_dovecot_comm">Postfix to
+Dovecot SASL communication</a>". </p>
+
+<ul>
+
+<li> <p> If you configured Dovecot for UNIX-domain socket communication,
+configure Postfix as follows: </p>
 
-<blockquote>
 <pre>
 /etc/postfix/<a href="postconf.5.html">main.cf</a>:
     <a href="postconf.5.html#smtpd_sasl_path">smtpd_sasl_path</a> = private/auth
 </pre>
-</blockquote>
-
-<blockquote>
 
 <strong>Note</strong>
 
@@ -1116,7 +1165,16 @@ find the Dovecot SASL socket: </p>
 directory, so that it will work whether or not the Postfix SMTP
 server runs chrooted. </p>
 
-</blockquote>
+<li> <p> If you configured Dovecot for TCP socket communication,
+configure Postfix as follows (if Dovecot runs on a different
+machine, replace 127.0.0.1 by that machine's IP address): </p>
+
+<pre>
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
+    <a href="postconf.5.html#smtpd_sasl_path">smtpd_sasl_path</a> = inet:127.0.0.1:12345
+</pre>
+
+</ul>
 
 <h4><a name="server_sasl_authc">Enabling SASL authentication
 in the Postfix SMTP server</a></h4>
index 1b27e795b3c73bc3a7c1bf0f717853a1d0c3d9f1..652a7becc02aad4966564c36f95466521570a6a3 100644 (file)
@@ -10,14 +10,22 @@ POSTCONF(1)                                                        POSTCONF(1)
        postconf - Postfix configuration utility
 
 <b>SYNOPSIS</b>
-       <b>postconf</b> [<b>-dfhnv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter ...</i>]
+       <b>Managing <a href="postconf.5.html">main.cf</a>:</b>
 
-       <b>postconf</b> [<b>-aAflmMv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</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>-ev</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter=value ...</i>]
 
        <b>postconf</b> [<b>-#v</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>parameter ...</i>]
 
+       <b>Managing <a href="master.5.html">master.cf</a>:</b>
+
+       <b>postconf</b> [<b>-fMv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<i>service ...</i>]
+
+       <b>Managing other configuration:</b>
+
+       <b>postconf</b> [<b>-aAlmv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>]
+
        <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>
@@ -30,6 +38,12 @@ POSTCONF(1)                                                        POSTCONF(1)
 
        Options:
 
+       <b>-A</b>     List the available SASL client plug-in types.   The
+              SASL    plug-in   type   is   selected   with   the
+              <b><a href="postconf.5.html#smtp_sasl_type">smtp_sasl_type</a></b>  or   <b><a href="postconf.5.html#lmtp_sasl_type">lmtp_sasl_type</a></b>   configuration
+              parameters  by  specifying  one of the names listed
+              below.
+
        <b>-a</b>     List the available SASL server plug-in types.   The
               SASL    plug-in   type   is   selected   with   the
               <b><a href="postconf.5.html#smtpd_sasl_type">smtpd_sasl_type</a></b> configuration parameter by specify-
@@ -46,12 +60,6 @@ POSTCONF(1)                                                        POSTCONF(1)
               This  feature  is  available  with  Postfix 2.3 and
               later.
 
-       <b>-A</b>     List the available SASL client plug-in types.   The
-              SASL    plug-in   type   is   selected   with   the
-              <b><a href="postconf.5.html#smtp_sasl_type">smtp_sasl_type</a></b>  or   <b><a href="postconf.5.html#lmtp_sasl_type">lmtp_sasl_type</a></b>   configuration
-              parameters  by  specifying  one of the names listed
-              below.
-
               <b>cyrus</b>  This client plug-in is available when  Post-
                      fix is built with Cyrus SASL support.
 
@@ -120,23 +128,40 @@ POSTCONF(1)                                                        POSTCONF(1)
                      lock file, as well as stale lock files  that
                      were left behind after abnormal termination.
 
+       <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.   Use  <b>-Mf</b>  to  fold long lines for
+              human readability.
+
+              If <i>service ...</i> is specified, only the matching ser-
+              vices  will  be  output.  For example, a service of
+              <b>inet</b> will match all services  that  listen  on  the
+              network.
+
+              Specify zero or more argument, each with a <i>service-</i>
+              <i>type</i> name (<b>inet</b>, <b>unix</b>, <b>fifo</b>, or  <b>pass</b>)  or  with  a
+              <i>service-name.service-type</i>  pair, where <i>service-name</i>
+              is the first field of a <a href="master.5.html">master.cf</a> entry.
+
+              This feature is  available  with  Postfix  2.9  and
+              later.
+
        <b>-m</b>     List the names of all supported lookup table types.
-              In  Postfix  configuration files, lookup tables are
-              specified as <i>type</i><b>:</b><i>name</i>, where <i>type</i> is  one  of  the
-              types  listed  below. The table <i>name</i> syntax depends
-              on the lookup table type as described in the  <a href="DATABASE_README.html">DATA</a>-
+              In Postfix configuration files, lookup  tables  are
+              specified  as  <i>type</i><b>:</b><i>name</i>,  where <i>type</i> is one of the
+              types listed below. The table <i>name</i>  syntax  depends
+              on  the lookup table type as described in the <a href="DATABASE_README.html">DATA</a>-
               <a href="DATABASE_README.html">BASE_README</a> document.
 
-              <b>btree</b>  A  sorted, balanced tree structure.  This is
+              <b>btree</b>  A sorted, balanced tree structure.  This  is
                      available on systems with support for Berke-
                      ley DB databases.
 
-              <b>cdb</b>    A  read-optimized  structure with no support
-                     for incremental updates.  This is  available
+              <b>cdb</b>    A read-optimized structure with  no  support
+                     for  incremental updates.  This is available
                      on systems with support for CDB databases.
 
-              <b>cidr</b>   A  table  that associates values with Class-
-                     less Inter-Domain Routing  (CIDR)  patterns.
+              <b>cidr</b>   A table that associates values  with  Class-
+                     less  Inter-Domain  Routing (CIDR) patterns.
                      This is described in <a href="cidr_table.5.html"><b>cidr_table</b>(5)</a>.
 
               <b>dbm</b>    An indexed file type based on hashing.  This
@@ -145,12 +170,12 @@ POSTCONF(1)                                                        POSTCONF(1)
 
               <b>environ</b>
                      The  UNIX  process  environment  array.  The
-                     lookup key is the variable name.  Originally
-                     implemented  for  testing,  someone may find
+                     lookup  key is the variable name. Originally
+                     implemented for testing,  someone  may  find
                      this useful someday.
 
               <b>hash</b>   An indexed file type based on hashing.  This
-                     is  available  on  systems  with support for
+                     is available on  systems  with  support  for
                      Berkeley DB databases.
 
               <b>internal</b>
@@ -158,84 +183,77 @@ POSTCONF(1)                                                        POSTCONF(1)
                      tent are lost when a process terminates.
 
               <b>ldap</b> (read-only)
-                     Perform  lookups  using  the  LDAP protocol.
+                     Perform lookups  using  the  LDAP  protocol.
                      This is described in <a href="ldap_table.5.html"><b>ldap_table</b>(5)</a>.
 
               <b>mysql</b> (read-only)
-                     Perform lookups using  the  MYSQL  protocol.
+                     Perform  lookups  using  the MYSQL protocol.
                      This is described in <a href="mysql_table.5.html"><b>mysql_table</b>(5)</a>.
 
               <b>pcre</b> (read-only)
                      A lookup table based on Perl Compatible Reg-
-                     ular  Expressions.  The   file   format   is
+                     ular   Expressions.   The   file  format  is
                      described in <a href="pcre_table.5.html"><b>pcre_table</b>(5)</a>.
 
               <b>pgsql</b> (read-only)
-                     Perform  lookups using the PostgreSQL proto-
+                     Perform lookups using the PostgreSQL  proto-
                      col. This is described in <a href="pgsql_table.5.html"><b>pgsql_table</b>(5)</a>.
 
               <b>proxy</b> (read-only)
-                     A lookup table that is implemented  via  the
-                     Postfix  <a href="proxymap.8.html"><b>proxymap</b>(8)</a> service. The table name
+                     A  lookup  table that is implemented via the
+                     Postfix <a href="proxymap.8.html"><b>proxymap</b>(8)</a> service. The table  name
                      syntax is <i>type</i><b>:</b><i>name</i>.
 
               <b>regexp</b> (read-only)
                      A lookup table based on regular expressions.
-                     The  file  format is described in <a href="regexp_table.5.html"><b>regexp_ta-</b></a>
+                     The file format is described  in  <a href="regexp_table.5.html"><b>regexp_ta-</b></a>
                      <a href="regexp_table.5.html"><b>ble</b>(5)</a>.
 
               <b>sdbm</b>   An indexed file type based on hashing.  This
-                     is  available  on  systems  with support for
+                     is available on  systems  with  support  for
                      SDBM databases.
 
               <b>sqlite</b> (read-only)
-                     Perform lookups from SQLite database  files.
+                     Perform  lookups from SQLite database files.
                      This is described in <a href="sqlite_table.5.html"><b>sqlite_table</b>(5)</a>.
 
               <b>static</b> (read-only)
-                     A  table  that  always  returns  its name as
-                     lookup result.  For  example,  <b><a href="DATABASE_README.html#types">static</a>:foobar</b>
-                     always  returns  the string <b>foobar</b> as lookup
+                     A table that  always  returns  its  name  as
+                     lookup  result.  For  example, <b><a href="DATABASE_README.html#types">static</a>:foobar</b>
+                     always returns the string <b>foobar</b>  as  lookup
                      result.
 
               <b>tcp</b> (read-only)
                      Perform lookups using a simple request-reply
-                     protocol  that is described in <a href="tcp_table.5.html"><b>tcp_table</b>(5)</a>.
+                     protocol that is described in  <a href="tcp_table.5.html"><b>tcp_table</b>(5)</a>.
 
               <b>texthash</b> (read-only)
-                     Produces similar  results  as  hash:  files,
+                     Produces  similar  results  as  hash: files,
                      except  that  you  don't  need  to  run  the
-                     <a href="postmap.1.html">postmap(1)</a> command before you  can  use  the
-                     file,  and  that  it does not detect changes
+                     <a href="postmap.1.html">postmap(1)</a>  command  before  you can use the
+                     file, and that it does  not  detect  changes
                      after the file is read.
 
               <b>unix</b> (read-only)
-                     A limited way to query the UNIX  authentica-
+                     A  limited way to query the UNIX authentica-
                      tion  database.  The  following  tables  are
                      implemented:
 
                      <b>unix:passwd.byname</b>
-                            The table is the UNIX password  data-
-                            base.  The  key is a login name.  The
-                            result is a password  file  entry  in
+                            The  table is the UNIX password data-
+                            base. The key is a login  name.   The
+                            result  is  a  password file entry in
                             <b>passwd</b>(5) format.
 
                      <b>unix:group.byname</b>
                             The table is the UNIX group database.
-                            The key is a group name.  The  result
-                            is  a  group  file  entry in <b>group</b>(5)
+                            The  key is a group name.  The result
+                            is a group  file  entry  in  <b>group</b>(5)
                             format.
 
-              Other table types may exist depending on how  Post-
+              Other  table types may exist depending on how Post-
               fix was built.
 
-       <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>.
 
index 28d35f71b63e7cc1f6c4f86a35b34e64b216772b..d9917185cbbe6d637d86edbc37710d154a3ab3b0 100644 (file)
@@ -9,17 +9,26 @@ Postfix configuration utility
 .na
 .nf
 .fi
+\fBManaging main.cf:\fR
+
 \fBpostconf\fR [\fB-dfhnv\fR] [\fB-c \fIconfig_dir\fR]
 [\fIparameter ...\fR]
 
-\fBpostconf\fR [\fB-aAflmMv\fR] [\fB-c \fIconfig_dir\fR]
-
 \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
 [\fIparameter=value ...\fR]
 
 \fBpostconf\fR [\fB-#v\fR] [\fB-c \fIconfig_dir\fR]
 [\fIparameter ...\fR]
 
+\fBManaging master.cf:\fR
+
+\fBpostconf\fR [\fB-fMv\fR] [\fB-c \fIconfig_dir\fR]
+[\fIservice ...\fR]
+
+\fBManaging other configuration:\fR
+
+\fBpostconf\fR [\fB-aAlmv\fR] [\fB-c \fIconfig_dir\fR]
+
 \fBpostconf\fR [\fB-btv\fR] [\fB-c \fIconfig_dir\fR] [\fItemplate_file\fR]
 .SH DESCRIPTION
 .ad
@@ -32,6 +41,11 @@ parameter values, or display other configuration information
 about the Postfix mail system.
 
 Options:
+.IP \fB-A\fR
+List the available SASL client plug-in types.  The SASL
+plug-in type is selected with the \fBsmtp_sasl_type\fR or
+\fBlmtp_sasl_type\fR configuration parameters by specifying
+one of the names listed below.
 .IP \fB-a\fR
 List the available SASL server plug-in types.  The SASL
 plug-in type is selected with the \fBsmtpd_sasl_type\fR
@@ -48,11 +62,6 @@ support.
 .RE
 .IP
 This feature is available with Postfix 2.3 and later.
-.IP \fB-A\fR
-List the available SASL client plug-in types.  The SASL
-plug-in type is selected with the \fBsmtp_sasl_type\fR or
-\fBlmtp_sasl_type\fR configuration parameters by specifying
-one of the names listed below.
 .RS
 .IP \fBcyrus\fR
 This client plug-in is available when Postfix is built with
@@ -109,6 +118,21 @@ named \fIfilename\fR by creating a file named \fIfilename\fB.lock\fR.
 The application is expected to remove its own lock file, as well as
 stale lock files that were left behind after abnormal termination.
 .RE
+.IP \fB-M\fR
+Show \fBmaster.cf\fR file contents instead of \fBmain.cf\fR
+file contents.  Use \fB-Mf\fR to fold long lines for human
+readability.
+
+If \fIservice ...\fR is specified, only the matching services
+will be output. For example, a service of \fBinet\fR will
+match all services that listen on the network.
+
+Specify zero or more argument, each with a \fIservice-type\fR
+name (\fBinet\fR, \fBunix\fR, \fBfifo\fR, or \fBpass\fR)
+or with a \fIservice-name.service-type\fR pair, where
+\fIservice-name\fR is the first field of a master.cf entry.
+
+This feature is available with Postfix 2.9 and later.
 .IP \fB-m\fR
 List the names of all supported lookup table types. In Postfix
 configuration files,
@@ -191,12 +215,6 @@ 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 \fBmain.cf\fR parameter settings that are explicitly
 specified in \fBmain.cf\fR.
index d73ae7726c7c4e203431ee10cb09654c57eb6385..75af77747264d212dd365ee97c3806a71d955ee1 100644 (file)
@@ -185,7 +185,13 @@ to configure and operate the Dovecot authentication server.  </p>
 <h4><a name="server_dovecot_comm">Postfix to Dovecot SASL communication</a></h4>
 
 <p> Communication between the Postfix SMTP server
-and Dovecot SASL happens via a UNIX-domain socket.  The socket
+and Dovecot SASL happens via a UNIX-domain socket.  Additionally,
+when using Dovecot version 2.0 and later, communication can take
+place over a TCP socket.
+
+<h5>UNIX-domain socket communication</h5>
+
+<p> The socket
 pathname and the list of mechanisms offered to Postfix need to be
 specified on the Dovecot server side in <code>dovecot.conf</code>.
 </p>
@@ -224,6 +230,46 @@ lines 11-13 limit read+write permissions to user and group
 SASL authentication and authorization in the Postfix SMTP server</a>"
 to turn on and use SASL in the Postfix SMTP server.  </p>
 
+<h5>TCP socket communication</h5>
+
+<p> The TCP port and the list of mechanisms offered to Postfix need
+to be specified on the Dovecot server side in <code>10-auth.conf</code>
+and <code>10-master.conf</code>. </p>
+
+<p> The following examples assume that Postfix should communicate
+with Dovecot on TCP port 12345. </p>
+
+<blockquote>
+<pre>
+1 /etc/dovecot/conf.d/10-auth.conf:
+2     auth_mechanisms = plain login
+</pre>
+</blockquote>
+
+<p> Line 2 provides plain and login as mechanisms for the Postfix
+SMTP server. </p>
+
+<blockquote>
+<pre>
+1 /etc/dovecot/conf.d/10-master.conf:
+2     service auth {
+3       unix_listener auth-userdb {
+4       }
+5       inet_listener {
+6         port = 12345
+7       }
+8     }
+</pre>
+</blockquote>
+
+<p> Line 5 creates a new TCP socket and line 6 specifies port 12345
+where Dovecot SASL should wait for Postfix authentication requests.
+</p>
+
+<p> Proceed with the section "<a href="#server_sasl_enable">Enabling
+SASL authentication and authorization in the Postfix SMTP server</a>"
+to turn on and use SASL in the Postfix SMTP server.  </p>
+
 <h3><a name="server_cyrus">Configuring Cyrus SASL</a></h3>
 
 <p> The Cyrus SASL framework supports a wide variety of applications
@@ -1098,17 +1144,20 @@ instead of <code>cyrus</code>: </p>
 </pre>
 </blockquote>
 
-<p> Additionally set the path where the Postfix SMTP server can
-find the Dovecot SASL socket: </p>
+<p> Additionally specify how Postfix SMTP server can find the Dovecot
+authentication server. This depends on the settings that you have
+selected in the section "<a href="#server_dovecot_comm">Postfix to
+Dovecot SASL communication</a>". </p>
+
+<ul>
+
+<li> <p> If you configured Dovecot for UNIX-domain socket communication,
+configure Postfix as follows: </p>
 
-<blockquote>
 <pre>
 /etc/postfix/main.cf:
     smtpd_sasl_path = private/auth
 </pre>
-</blockquote>
-
-<blockquote>
 
 <strong>Note</strong>
 
@@ -1116,7 +1165,16 @@ find the Dovecot SASL socket: </p>
 directory, so that it will work whether or not the Postfix SMTP
 server runs chrooted. </p>
 
-</blockquote>
+<li> <p> If you configured Dovecot for TCP socket communication,
+configure Postfix as follows (if Dovecot runs on a different
+machine, replace 127.0.0.1 by that machine's IP address): </p>
+
+<pre>
+/etc/postfix/main.cf:
+    smtpd_sasl_path = inet:127.0.0.1:12345
+</pre>
+
+</ul>
 
 <h4><a name="server_sasl_authc">Enabling SASL authentication
 in the Postfix SMTP server</a></h4>
index 47907172b5584d4e22ad31240f2df0e1aacd8dc1..524fbc480c54de8a4d1e3b4d8114aff083379198 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      "20111117"
+#define MAIL_RELEASE_DATE      "20111118"
 #define MAIL_VERSION_NUMBER    "2.9"
 
 #ifdef SNAPSHOT
index 3c47df75d380e9590c8d8a048030004fa2060946..353c4c504e091843cb4726a9153df5ad56322ddc 100644 (file)
@@ -9,6 +9,9 @@
 /*     ARGV    *match_service_init(pattern_list)
 /*     const char *pattern_list;
 /*
+/*     ARGV    *match_service_init_argv(pattern_list)
+/*     char    **pattern_list;
+/*
 /*     int     match_service_match(list, name_type)
 /*     ARGV    *list;
 /*     const char *name_type;
@@ -34,6 +37,9 @@
 /*     match_service_init() parses the pattern list. The result
 /*     must be passed to match_service_match() or match_service_free().
 /*
+/*     match_service_init_argv() provides an alternate interface
+/*     for pre-parsed strings.
+/*
 /*     match_service_match() matches one service name.type string
 /*     against the specified pattern list.
 /*
@@ -83,12 +89,25 @@ ARGV   *match_service_init(const char *patterns)
     const char *item;
 
     while ((item = mystrtok(&bp, delim)) != 0)
-        argv_add(list, item, (char *) 0);
+       argv_add(list, item, (char *) 0);
     argv_terminate(list);
     myfree(saved_patterns);
     return (list);
 }
 
+/* match_service_init_argv - impedance adapter */
+
+ARGV   *match_service_init_argv(char **patterns)
+{
+    ARGV   *list = argv_alloc(1);
+    char  **cpp;
+
+    for (cpp = patterns; *cpp; cpp++)
+       argv_add(list, *cpp, (char *) 0);
+    argv_terminate(list);
+    return (list);
+}
+
 /* match_service_match - match service name.type against pattern list */
 
 int     match_service_match(ARGV *list, const char *name_type)
index 1e343336d58d47c1913dd0311694c9f5a21b313f..28828e15fb7d3878d481b571e62eb3a99f266a39 100644 (file)
@@ -14,6 +14,7 @@
  /* External interface. */
 
 extern ARGV *match_service_init(const char *);
+extern ARGV *match_service_init_argv(char **);
 extern int match_service_match(ARGV *, const char *);
 extern void match_service_free(ARGV *);
 
index eec7626a81823c4e7b826b5d74c0ac46ef075824..63701be546360e2814ca2a4d44257b13ecbf0a50 100644 (file)
@@ -36,7 +36,7 @@ Makefile: Makefile.in
 
 test:  $(TESTPROG)
 
-tests: test1 test2 test3 test4 test5 test6 test7 test8
+tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11
 
 root_tests:
 
@@ -142,6 +142,33 @@ test8:     $(PROG) test8.ref
        diff test8.ref test8.tmp
        rm -f main.cf master.cf test8.tmp
 
+test9: $(PROG) test9.ref
+       rm -f main.cf master.cf
+       touch main.cf master.cf
+       echo foo inet - n n - 0 spawn >> master.cf
+       echo bar unix - n n - 0 spawn >> master.cf
+       ./$(PROG) -c . -M inet >test9.tmp 2>&1
+       diff test9.ref test9.tmp
+       rm -f main.cf master.cf test9.tmp
+
+test10:        $(PROG) test10.ref
+       rm -f main.cf master.cf
+       touch main.cf master.cf
+       echo foo inet - n n - 0 spawn >> master.cf
+       echo bar unix - n n - 0 spawn >> master.cf
+       ./$(PROG) -c . -M bar.inet foo.unix >test10.tmp 2>&1
+       diff test10.ref test10.tmp
+       rm -f main.cf master.cf test10.tmp
+
+test11:        $(PROG) test11.ref
+       rm -f main.cf master.cf
+       touch main.cf master.cf
+       echo foo inet - n n - 0 spawn >> master.cf
+       echo bar unix - n n - 0 spawn >> master.cf
+       ./$(PROG) -c . -M >test11.tmp 2>&1
+       diff test11.ref test11.tmp
+       rm -f main.cf master.cf test11.tmp
+
 printfck: $(OBJS) $(PROG)
        rm -rf printfck
        mkdir printfck
@@ -188,6 +215,7 @@ postconf.o: ../../include/mail_proto.h
 postconf.o: ../../include/mail_run.h
 postconf.o: ../../include/mail_version.h
 postconf.o: ../../include/master_proto.h
+postconf.o: ../../include/match_service.h
 postconf.o: ../../include/mbox_conf.h
 postconf.o: ../../include/msg.h
 postconf.o: ../../include/msg_vstream.h
index cbc079be12c1a7dc5c4a48ac2d03f465940421c3..b6ca2da6358c7e4b39b17da3b4898112c186aae9 100644 (file)
@@ -5,17 +5,26 @@
 /*     Postfix configuration utility
 /* SYNOPSIS
 /* .fi
+/*     \fBManaging main.cf:\fR
+/*
 /*     \fBpostconf\fR [\fB-dfhnv\fR] [\fB-c \fIconfig_dir\fR]
 /*     [\fIparameter ...\fR]
 /*
-/*     \fBpostconf\fR [\fB-aAflmMv\fR] [\fB-c \fIconfig_dir\fR]
-/*
 /*     \fBpostconf\fR [\fB-ev\fR] [\fB-c \fIconfig_dir\fR]
 /*     [\fIparameter=value ...\fR]
 /*
 /*     \fBpostconf\fR [\fB-#v\fR] [\fB-c \fIconfig_dir\fR]
 /*     [\fIparameter ...\fR]
 /*
+/*     \fBManaging master.cf:\fR
+/*
+/*     \fBpostconf\fR [\fB-fMv\fR] [\fB-c \fIconfig_dir\fR]
+/*     [\fIservice ...\fR]
+/*
+/*     \fBManaging other configuration:\fR
+/*
+/*     \fBpostconf\fR [\fB-aAlmv\fR] [\fB-c \fIconfig_dir\fR]
+/*
 /*     \fBpostconf\fR [\fB-btv\fR] [\fB-c \fIconfig_dir\fR] [\fItemplate_file\fR]
 /* DESCRIPTION
 /*     By default, the \fBpostconf\fR(1) command displays the
 /*     about the Postfix mail system.
 /*
 /*     Options:
+/* .IP \fB-A\fR
+/*     List the available SASL client plug-in types.  The SASL
+/*     plug-in type is selected with the \fBsmtp_sasl_type\fR or
+/*     \fBlmtp_sasl_type\fR configuration parameters by specifying
+/*     one of the names listed below.
 /* .IP \fB-a\fR
 /*     List the available SASL server plug-in types.  The SASL
 /*     plug-in type is selected with the \fBsmtpd_sasl_type\fR
 /* .RE
 /* .IP
 /*     This feature is available with Postfix 2.3 and later.
-/* .IP \fB-A\fR
-/*     List the available SASL client plug-in types.  The SASL
-/*     plug-in type is selected with the \fBsmtp_sasl_type\fR or
-/*     \fBlmtp_sasl_type\fR configuration parameters by specifying
-/*     one of the names listed below.
 /* .RS
 /* .IP \fBcyrus\fR
 /*     This client plug-in is available when Postfix is built with
 /*     The application is expected to remove its own lock file, as well as
 /*     stale lock files that were left behind after abnormal termination.
 /* .RE
+/* .IP \fB-M\fR
+/*     Show \fBmaster.cf\fR file contents instead of \fBmain.cf\fR
+/*     file contents.  Use \fB-Mf\fR to fold long lines for human
+/*     readability.
+/*
+/*     If \fIservice ...\fR is specified, only the matching services
+/*     will be output. For example, a service of \fBinet\fR will
+/*     match all services that listen on the network.
+/*
+/*     Specify zero or more argument, each with a \fIservice-type\fR
+/*     name (\fBinet\fR, \fBunix\fR, \fBfifo\fR, or \fBpass\fR)
+/*     or with a \fIservice-name.service-type\fR pair, where
+/*     \fIservice-name\fR is the first field of a master.cf entry.
+/*
+/*     This feature is available with Postfix 2.9 and later.
 /* .IP \fB-m\fR
 /*     List the names of all supported lookup table types. In Postfix
 /*     configuration files,
 /* .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 \fBmain.cf\fR parameter settings that are explicitly
 /*     specified in \fBmain.cf\fR.
 #include <mail_addr.h>
 #include <mbox_conf.h>
 #include <mail_run.h>
+#include <match_service.h>
 
 /* XSASL library. */
 
@@ -496,6 +515,19 @@ static const CONFIG_STR_FN_TABLE str_fn_table_2[] = {
 #define DEF_MODE       SHOW_NAME
 static int cmd_mode = DEF_MODE;
 
+/* set_config_dir - forcibly override var_config_dir */
+
+static void set_config_dir(void)
+{
+    char   *config_dir;
+
+    if (var_config_dir)
+       myfree(var_config_dir);
+    var_config_dir = mystrdup((config_dir = safe_getenv(CONF_ENV_PATH)) != 0 ?
+                             config_dir : DEF_CONFIG_DIR);     /* XXX */
+    set_mail_conf_str(VAR_CONFIG_DIR, var_config_dir);
+}
+
 /* check_myhostname - lookup hostname and validate */
 
 static const char *check_myhostname(void)
@@ -584,7 +616,6 @@ static const char *check_mynetworks(void)
 
 static void edit_parameters(int cmd_mode, int argc, char **argv)
 {
-    char   *config_dir;
     char   *path;
     EDIT_FILE *ep;
     VSTREAM *src;
@@ -636,20 +667,12 @@ static void edit_parameters(int cmd_mode, int argc, char **argv)
        htable_enter(table, edit_key, (char *) cvalue);
     }
 
-    /*
-     * XXX Avoid code duplication by better code decomposition.
-     */
-    if (var_config_dir)
-       myfree(var_config_dir);
-    var_config_dir = mystrdup((config_dir = safe_getenv(CONF_ENV_PATH)) != 0 ?
-                             config_dir : DEF_CONFIG_DIR);     /* XXX */
-    set_mail_conf_str(VAR_CONFIG_DIR, var_config_dir);
-
     /*
      * Open a temp file for the result. This uses a deterministic name so we
      * don't leave behind thrash with random names.
      */
-    path = concatenate(var_config_dir, "/", "main.cf", (char *) 0);
+    set_config_dir();
+    path = concatenate(var_config_dir, "/", MAIN_CONF_FILE, (char *) 0);
     if ((ep = edit_file_open(path, O_CREAT | O_WRONLY, 0644)) == 0)
        msg_fatal("open %s%s: %m", path, EDIT_FILE_SUFFIX);
     dst = ep->tmp_fp;
@@ -732,19 +755,6 @@ static void edit_parameters(int cmd_mode, int argc, char **argv)
     htable_free(table, myfree);
 }
 
-/* set_config_dir - forcibly override var_config_dir */
-
-static void set_config_dir(void)
-{
-    char   *config_dir;
-
-    if (var_config_dir)
-       myfree(var_config_dir);
-    var_config_dir = mystrdup((config_dir = safe_getenv(CONF_ENV_PATH)) != 0 ?
-                             config_dir : DEF_CONFIG_DIR);     /* XXX */
-    set_mail_conf_str(VAR_CONFIG_DIR, var_config_dir);
-}
-
 /* read_parameters - read parameter info from file */
 
 static void read_parameters(void)
@@ -757,7 +767,7 @@ static void read_parameters(void)
      */
     dict_unknown_allowed = 1;
     set_config_dir();
-    path = concatenate(var_config_dir, "/", "main.cf", (char *) 0);
+    path = concatenate(var_config_dir, "/", MAIN_CONF_FILE, (char *) 0);
     dict_load_file(CONFIG_DICT, path);
     myfree(path);
 }
@@ -982,7 +992,6 @@ static void add_user_parameter(const char *name)
 
 /* scan_user_parameter_value - extract macro names from parameter value */
 
-#ifdef MAC_EXP_FLAG_SCAN
 #define NO_SCAN_RESULT ((VSTRING *) 0)
 #define NO_SCAN_FILTER ((char *) 0)
 #define NO_SCAN_MODE   (0)
@@ -992,9 +1001,6 @@ static void add_user_parameter(const char *name)
     (void) mac_expand(NO_SCAN_RESULT, (value), MAC_EXP_FLAG_SCAN, \
                    NO_SCAN_FILTER, check_user_parameter, NO_SCAN_CONTEXT); \
 } while (0)
-#else
-#define scan_user_parameter_value(value) do { /* void */; } while (0)
-#endif
 
 /* check_user_parameter - try to promote user-defined parameter */
 
@@ -1650,12 +1656,10 @@ static void show_locks(void)
     argv_free(locks_argv);
 }
 
-/* show_master - show master.cf entries */
+/* print_master_line - print one master line */
 
-static void show_master(int mode)
+static void print_master_line(int mode, ARGV *argv)
 {
-    ARGV  **argvp;
-    ARGV   *argv;
     char   *arg;
     char   *aval;
     int     line_len;
@@ -1677,77 +1681,109 @@ static void show_master(int mode)
     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;
+    /*
+     * 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_TEXT(arg, strlen(arg));
+           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;
-                   }
-               }
+    /*
+     * 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 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) {
+           /*
+            * 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;
-                   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).
+            * Try to avoid breaking "-o name=value" over multiple lines if
+            * it would fit on one line.
             */
-           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;
-               }
+           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;
            }
-           ADD_TEXT(arg, strlen(arg));
        }
-       vstream_fputs("\n", VSTREAM_OUT);
+
+       /*
+        * 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_master - show master.cf entries */
+
+static void show_master(int mode, char **filters)
+{
+    ARGV  **argvp;
+    ARGV   *argv;
+    VSTRING *service_name = 0;
+    ARGV   *service_filter = 0;
+
+    /*
+     * Initialize the service filter.
+     */
+    if (filters[0]) {
+       service_name = vstring_alloc(10);
+       service_filter = match_service_init_argv(filters);
+    }
+
+    /*
+     * Iterate over the master table.
+     */
+    for (argvp = master_table; (argv = *argvp) != 0; argvp++) {
+       if (service_filter) {
+           vstring_sprintf(service_name, "%s.%s",
+                           argv->argv[0], argv->argv[1]);
+           if (match_service_match(service_filter, STR(service_name)) == 0)
+               continue;
+       }
+       print_master_line(mode, argv);
+    }
+    if (service_filter) {
+       argv_free(service_filter);
+       vstring_free(service_name);
     }
 }
 
@@ -2004,7 +2040,7 @@ int     main(int argc, char **argv)
      */
     else if (cmd_mode & SHOW_MASTER) {
        read_master();
-       show_master(cmd_mode);
+       show_master(cmd_mode, argv + optind);
     }
 
     /*
@@ -2056,12 +2092,10 @@ int     main(int argc, char **argv)
         * because that ignores all the user-specified parameters and
         * user-specified macro expansions in main.cf.
         */
-#ifdef MAC_EXP_FLAG_SCAN
        if ((cmd_mode & SHOW_DEFS) == 0) {
            flag_unused_main_parameters();
            flag_unused_master_parameters();
        }
-#endif
     }
     vstream_fflush(VSTREAM_OUT);
     exit(0);
diff --git a/postfix/src/postconf/test10.ref b/postfix/src/postconf/test10.ref
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/postfix/src/postconf/test11.ref b/postfix/src/postconf/test11.ref
new file mode 100644 (file)
index 0000000..c4cc727
--- /dev/null
@@ -0,0 +1,2 @@
+foo        inet  -       n       n       -       0       spawn
+bar        unix  -       n       n       -       0       spawn
diff --git a/postfix/src/postconf/test9.ref b/postfix/src/postconf/test9.ref
new file mode 100644 (file)
index 0000000..b62303f
--- /dev/null
@@ -0,0 +1 @@
+foo        inet  -       n       n       -       0       spawn