]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.2-20041021
authorWietse Venema <wietse@porcupine.org>
Thu, 21 Oct 2004 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:30:05 +0000 (06:30 +0000)
35 files changed:
postfix/HISTORY
postfix/html/postconf.5.html
postfix/html/smtpd.8.html
postfix/html/trivial-rewrite.8.html
postfix/man/man5/postconf.5
postfix/man/man8/smtpd.8
postfix/man/man8/trivial-rewrite.8
postfix/mantools/postlink
postfix/proto/postconf.proto
postfix/src/cleanup/Makefile.in
postfix/src/cleanup/cleanup_addr.c
postfix/src/cleanup/cleanup_envelope.c
postfix/src/cleanup/cleanup_message.c
postfix/src/cleanup/cleanup_rewrite.c
postfix/src/cleanup/cleanup_state.c
postfix/src/global/Makefile.in
postfix/src/global/deliver_request.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/global/rewrite_clnt.h
postfix/src/global/rewrite_clnt.in
postfix/src/global/rewrite_clnt.ref
postfix/src/lmtp/lmtp_proto.c
postfix/src/local/Makefile.in
postfix/src/oqmgr/qmgr_message.c
postfix/src/qmgr/qmgr_message.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd.h
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_proxy.c
postfix/src/smtpd/smtpd_state.c
postfix/src/trivial-rewrite/Makefile.in
postfix/src/trivial-rewrite/rewrite.c
postfix/src/trivial-rewrite/trivial-rewrite.c

index 6d892e6aaf440a4f035ebdfc3ab47861d7b9b9b3..cf842ac64f805cf81852dc9e0cb9341b779ec4a5 100644 (file)
@@ -9774,33 +9774,28 @@ Apologies for any names omitted.
 
        Portability: AIX 5.1/GCC.
 
-20041014-19
+20041014-21
 
-       Message header address rewriting contexts, so that spam
-       from badly written software won't look like it came from
-       a local user.
+       By default, Postfix no longer appends the local domain to
+       incomplete message header addresses from remote clients.
+       Thus, spam from badly written software no longer looks like
+       it came from a local user.
 
-       The default "local" rewriting context appends "@$myorigin"
-       or ".$mydomain" to incomplete message header addresses,
-       just like Postfix has always done.
-
-       The new "invalid" address context appends "domain.invalid"
-       instead (or whatever domain name is specified with the
-       invalid_rewrite_context_domain parameter).
-
-       The new "none" address rewriting context does not modify
-       message header addresses at all.
+       Instead, Postfix either does not rewrite headers from remote
+       clients at all, or it appends the domain name that is
+       specified with the new invalid_rewrite_context_domain
+       parameter.
 
-       Postfix uses the "local" rewriting context for mail posted
-       with Postfix sendmail, from clients listed with the
-       local_rewrite_context_clients parameter (default:  $mynetworks)
-       and from SASL authenticated clients.
+       Postfix still appends $@myorigin or .$mydomain to headers
+       in mail from Postfix sendmail, from clients listed with
+       the local_rewrite_context_clients parameter (default:
+       permit_mynetworks, permit_sasl_authenticated).
 
        The context specified with remote_rewrite_context_name is
        used for all other clients. The default setting is backwards
        compatible to avoid surprises.
 
-       Postfix always uses the "local" rewriting context to update
+       Postfix still appends $@myorigin or .$mydomain when rewriting
        incomplete envelope addresses.
 
 20041018
@@ -9814,6 +9809,11 @@ Apologies for any names omitted.
 
 Open problems:
 
+       High: document master(5) for generic daemon options.
+
+       Low: reject HELO with any domain name that this MTA is
+       final destination for.
+
        Low: should the Delivered-To: test in local(8) be configurable?
 
        Low: append a different domain (like, address.invalid) for
index a49dd406ec0b2656a3c5e5da10072d3150e947d0..3c8f5d41559851ffea0a480b1312dadf2c1ecdab 100644 (file)
@@ -672,7 +672,7 @@ The default time unit is s (seconds).
 <p>
 With locally submitted mail, append the string "@$<a href="postconf.5.html#myorigin">myorigin</a>" to mail
 addresses without domain information. With remotely submitted mail,
-append the string "@$invalid_domain" instead.
+append the string "@$<a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a>" instead.
 </p>
 
 <p>
@@ -689,7 +689,8 @@ Postfix does not support domain-less addresses.
 <p>
 With locally submitted mail, append the string ".$<a href="postconf.5.html#mydomain">mydomain</a>" to
 addresses that have no ".domain" information. With remotely submitted
-mail, append the string ".$invalid_domain" instead.
+mail, append the string ".$<a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a>"
+instead.
 </p>
 
 <p>
@@ -2571,17 +2572,6 @@ block all mail to a site.
 </p>
 
 
-</DD>
-
-<DT><b><a name="invalid_header_rewrite_context_domain">invalid_header_rewrite_context_domain</a>
-(default: domain.invalid)</b></DT><DD>
-
-<p> Append this domain to incomplete message header addresses from
-remote clients, when $<a href="postconf.5.html#remote_header_rewrite_context_name">remote_header_rewrite_context_name</a> is set to
-"invalid".  This is one way to avoid appending your own domain to
-addresses in spam from poorly written software. </p>
-
-
 </DD>
 
 <DT><b><a name="invalid_hostname_reject_code">invalid_hostname_reject_code</a>
@@ -3082,34 +3072,61 @@ into concurrency per domain.  </p>
 
 </DD>
 
-<DT><b><a name="local_header_rewrite_context_clients">local_header_rewrite_context_clients</a>
-(default: $<a href="postconf.5.html#mynetworks">mynetworks</a>)</b></DT><DD>
+<DT><b><a name="local_header_rewrite_clients">local_header_rewrite_clients</a>
+(default: see "postconf -d" output)</b></DT><DD>
 
-<p> Append the domain names in $<a href="postconf.5.html#myorigin">myorigin</a> and $<a href="postconf.5.html#mydomain">mydomain</a> to incomplete
-message header addresses from these clients.  </p>
+<p> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> to incomplete
+message header addresses from these clients; append
+$<a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a> for all other clients.  </p>
 
-<p> Specify a list of network addresses or network/netmask patterns,
-separated by comma or whitespace. Continue long lines by starting
-the next line with whitespace. </p>
+<p> Specify a list of zero or more of the following:  </p>
 
-<p> A network mask specifies the number of bits in the network part
-of a host address.  You can also specify "/file/name" or "<a href="DATABASE_README.html">type:table</a>"
-patterns.  A "/file/name" pattern is replaced by its contents; a
-"<a href="DATABASE_README.html">type:table</a>" lookup table is matched when a client name or address
-matches a lookup key (the lookup result is ignored). </p>
+<dl>
 
-<p> The list is matched left to right, and the search stops on the
-first match.  Specify "!pattern" to exclude an address or network
-block from the list.  </p>
+<dt> <b> <a href="postconf.5.html#permit_mynetworks">permit_mynetworks</a> </b></dt>
 
-<p>
-Examples:
-</p>
+<dd> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> when the
+client IP address matches any network or network address listed in
+$<a href="postconf.5.html#mynetworks">mynetworks</a>. This is enabled by default. </dd>
+
+<dt><b> <a href="postconf.5.html#permit_sasl_authenticated">permit_sasl_authenticated</a> </b></dt>
+
+<dd> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> when the
+client is successfully authenticated via the <a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a> (AUTH)
+protocol. This is enabled by default. </dd>
+
+<dt><b> <a href="postconf.5.html#permit_tls_clientcerts">permit_tls_clientcerts</a> </b></dt>
+
+<dd> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> when the
+client TLS certificate is successfully verified, and the client
+certificate fingerprint is listed on the server. This is enabled
+by default. </dd>
+
+<dt><b> <a href="postconf.5.html#permit_tls_all_clientcerts">permit_tls_all_clientcerts</a> </b></dt>
+
+<dd> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> when the
+client TLS certificate is successfully verified, regardless of
+whether it is listed on the server, and regardless of the certifying
+authority. </dd>
+
+<dt><b> <a name="check_address_map">check_address_map</a> <i><a
+href="DATABASE_README.html">type:table</a></i> </b></dt>
+
+<dt><b> <i><a href="DATABASE_README.html">type:table</a></i>
+</b></dt>
+
+<dd> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> when the
+client IP address matches the specified lookup table. The lookup
+result is ignored, and no subnet lookup is done. This is suitable
+for pop-before-smtp lookup tables. </dd>
+
+</dl>
+
+<p> Examples:  </p>
 
 <pre>
-<a href="postconf.5.html#local_header_rewrite_context_clients">local_header_rewrite_context_clients</a> = $<a href="postconf.5.html#mynetworks">mynetworks</a>
-<a href="postconf.5.html#local_header_rewrite_context_clients">local_header_rewrite_context_clients</a> = !192.168.0.1 $<a href="postconf.5.html#mynetworks">mynetworks</a>
-<a href="postconf.5.html#local_header_rewrite_context_clients">local_header_rewrite_context_clients</a> = static:all
+<a href="postconf.5.html#local_header_rewrite_clients">local_header_rewrite_clients</a> = static:all
+<a href="postconf.5.html#local_header_rewrite_clients">local_header_rewrite_clients</a> = <a href="postconf.5.html#permit_mynetworks">permit_mynetworks</a>, <a href="postconf.5.html#permit_sasl_authenticated">permit_sasl_authenticated</a>
 </pre>
 
 
@@ -5028,37 +5045,15 @@ Examples:
 
 </DD>
 
-<DT><b><a name="remote_header_rewrite_context_name">remote_header_rewrite_context_name</a>
-(default: local)</b></DT><DD>
-
-<p> The address rewriting context that should be used for incomplete
-mail header addresses from remote clients. </p>
-
-<ul>
-
-<li> <p> <b>local</b> Append the domains specified with $<a href="postconf.5.html#myorigin">myorigin</a>
-or $<a href="postconf.5.html#mydomain">mydomain</a> to incomplete message header addresses from remote
-clients.  </p>
+<DT><b><a name="remote_header_rewrite_domain">remote_header_rewrite_domain</a>
+(default: domain.invalid)</b></DT><DD>
 
-<li> <p> <b>invalid</b> Append the domain specified with
-$<a href="postconf.5.html#invalid_header_rewrite_context_domain">invalid_header_rewrite_context_domain</a> to incomplete message header
-addresses from remote clients. This is one way to avoid appending
+<p> Append this domain name to incomplete message header addresses
+from remote clients; when this domain name is empty, don't rewrite
+remote message headers at all.  Both stop Postfix from appending
 your own domain to addresses in spam from poorly written software.
-This is a safe choice for gateways that have no control over
-address rewriting by down-stream systems.
 </p>
 
-<li> <p> <b>none</b> Don't modify message headers from remote
-clients at all. This is another way to avoid appending your own
-domain to addresses in spam from poorly written software. This
-is the preferred choice for purists. </p>
-
-</ul>
-
-<p> Note: Postfix always appends the domains specified with $<a href="postconf.5.html#myorigin">myorigin</a>
-or $<a href="postconf.5.html#mydomain">mydomain</a> to incomplete envelope addresses, because those
-addresses are effectively equivalent to local addresses. </p>
-
 
 </DD>
 
@@ -6404,7 +6399,12 @@ least significant octets. See the <a href="access.5.html">access(5)</a> manual p
 <dt><b><a name="permit_mynetworks">permit_mynetworks</a></b></dt>
 
 <dd>Permit the request when the client IP address matches any
-network listed in  $<a href="postconf.5.html#mynetworks">mynetworks</a>. </dd>
+network or network address listed in  $<a href="postconf.5.html#mynetworks">mynetworks</a>. </dd>
+
+<dt><b><a name="permit_sasl_authenticated">permit_sasl_authenticated</a></b></dt>
+
+<dd> Permit the request when the client is successfully
+authenticated via the <a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a> (AUTH) protocol. </dd>
 
 <dt><b><a name="reject_rbl_client">reject_rbl_client <i>rbl_domain=d.d.d.d</i></a></b></dt>
 
@@ -7330,13 +7330,13 @@ the Postfix SMTP server does not use authentication.
 </p>
 
 <p>
-If a remote SMTP client is authenticated, the permit_sasl_authenticated
+If a remote SMTP client is authenticated, the <a href="postconf.5.html#permit_sasl_authenticated">permit_sasl_authenticated</a>
 access restriction can be used to permit relay access, like this:
 </p>
 
 <pre>
     <a href="postconf.5.html#smtpd_recipient_restrictions">smtpd_recipient_restrictions</a> =
-        <a href="postconf.5.html#permit_mynetworks">permit_mynetworks</a>, permit_sasl_authenticated, ...
+        <a href="postconf.5.html#permit_mynetworks">permit_mynetworks</a>, <a href="postconf.5.html#permit_sasl_authenticated">permit_sasl_authenticated</a>, ...
 </pre>
 
 <p> To reject all SMTP connections from unauthenticated clients,
@@ -7344,7 +7344,7 @@ specify "<a href="postconf.5.html#smtpd_delay_reject">smtpd_delay_reject</a> = y
 </p>
 
 <pre>
-    <a href="postconf.5.html#smtpd_client_restrictions">smtpd_client_restrictions</a> = permit_sasl_authenticated, reject
+    <a href="postconf.5.html#smtpd_client_restrictions">smtpd_client_restrictions</a> = <a href="postconf.5.html#permit_sasl_authenticated">permit_sasl_authenticated</a>, reject
 </pre>
 
 <p>
index a4aee5498e3596db37fa89ce4982ae3a1c2af03d..2621c1efc08fb9a7be1c53ff06ccbea0bd8201b7 100644 (file)
@@ -110,45 +110,39 @@ SMTPD(8)                                                 SMTPD(8)
 
        Available in Postfix version 2.2 and later:
 
-       <b><a href="postconf.5.html#local_header_rewrite_context_clients">local_header_rewrite_context_clients</a> ($<a href="postconf.5.html#mynetworks">mynetworks</a>)</b>
-              Append the domain names in $<a href="postconf.5.html#myorigin">myorigin</a> and  $<a href="postconf.5.html#mydomain">mydomain</a>
-              to  incomplete  message header addresses from these
-              clients.
-
-       <b><a href="postconf.5.html#remote_header_rewrite_context_name">remote_header_rewrite_context_name</a> (local)</b>
-              The address rewriting context that should  be  used
-              for  incomplete  mail  header addresses from remote
-              clients.
-
-       Implemented by the <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a> server:
-
-       <b><a href="postconf.5.html#invalid_header_rewrite_context_domain">invalid_header_rewrite_context_domain</a> (domain.invalid)</b>
-              Append this domain  to  incomplete  message  header
-              addresses     from     remote     clients,     when
-              $<a href="postconf.5.html#remote_header_rewrite_context_name">remote_header_rewrite_context_name</a>   is   set   to
-              "invalid".
+       <b><a href="postconf.5.html#local_header_rewrite_clients">local_header_rewrite_clients</a> (see 'postconf -d' output)</b>
+              Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> to
+              incomplete  message  header  addresses  from  these
+              clients; append  $<a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a>  for
+              all other clients.
+
+       <b><a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a> (domain.invalid)</b>
+              Append  this  domain  name  to  incomplete  message
+              header addresses from  remote  clients;  when  this
+              domain  name is empty, don't rewrite remote message
+              headers at all.
 
 <b>AFTER QUEUE EXTERNAL CONTENT INSPECTION CONTROLS</b>
-       As  of  version 1.0, Postfix can be configured to send new
-       mail to an external  content  filter  AFTER  the  mail  is
-       queued.  This  content  filter  is expected to inject mail
-       back into a (Postfix or other) MTA for  further  delivery.
+       As of version 1.0, Postfix can be configured to  send  new
+       mail  to  an  external  content  filter  AFTER the mail is
+       queued. This content filter is  expected  to  inject  mail
+       back  into  a (Postfix or other) MTA for further delivery.
        See the <a href="FILTER_README.html">FILTER_README</a> document for details.
 
        <b><a href="postconf.5.html#content_filter">content_filter</a> (empty)</b>
-              The  name of a mail delivery transport that filters
+              The name of a mail delivery transport that  filters
               mail after it is queued.
 
 <b>BEFORE QUEUE EXTERNAL CONTENT INSPECTION CONTROLS</b>
-       As of version 2.1, the Postfix SMTP server can be  config-
-       ured  to send incoming mail to a real-time SMTP-based con-
+       As  of version 2.1, the Postfix SMTP server can be config-
+       ured to send incoming mail to a real-time SMTP-based  con-
        tent filter BEFORE mail is queued.  This content filter is
-       expected  to  inject  mail  back  into  Postfix.   See the
-       <a href="SMTPD_PROXY_README.html">SMTPD_PROXY_README</a> document for details on how to  config-
+       expected to  inject  mail  back  into  Postfix.   See  the
+       <a href="SMTPD_PROXY_README.html">SMTPD_PROXY_README</a>  document for details on how to config-
        ure and operate this feature.
 
        <b><a href="postconf.5.html#smtpd_proxy_filter">smtpd_proxy_filter</a> (empty)</b>
-              The  hostname  and  TCP  port of the mail filtering
+              The hostname and TCP port  of  the  mail  filtering
               proxy server.
 
        <b><a href="postconf.5.html#smtpd_proxy_ehlo">smtpd_proxy_ehlo</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
@@ -160,42 +154,42 @@ SMTPD(8)                                                 SMTPD(8)
               for sending or receiving information.
 
 <b>GENERAL CONTENT INSPECTION CONTROLS</b>
-       The following parameters are applicable for both  built-in
+       The  following parameters are applicable for both built-in
        and external content filters.
 
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#receive_override_options">receive_override_options</a> (empty)</b>
-              Enable  or  disable  recipient validation, built-in
+              Enable or disable  recipient  validation,  built-in
               content filtering, or address mapping.
 
 <b>EXTERNAL CONTENT INSPECTION CONTROLS</b>
-       The following parameters are applicable for  both  before-
+       The  following  parameters are applicable for both before-
        queue and after-queue content filtering.
 
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtpd_authorized_xforward_hosts">smtpd_authorized_xforward_hosts</a> (empty)</b>
-              What  SMTP  clients are allowed to use the XFORWARD
+              What SMTP clients are allowed to use  the  XFORWARD
               feature.
 
 <b>SASL AUTHENTICATION CONTROLS</b>
-       Postfix SASL support (<a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a>) can be used  to  authenti-
-       cate  remote  SMTP clients to the Postfix SMTP server, and
-       to authenticate the Postfix SMTP client to a  remote  SMTP
+       Postfix  SASL  support (<a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a>) can be used to authenti-
+       cate remote SMTP clients to the Postfix SMTP  server,  and
+       to  authenticate  the Postfix SMTP client to a remote SMTP
        server.  See the <a href="SASL_README.html">SASL_README</a> document for details.
 
        <b><a href="postconf.5.html#broken_sasl_auth_clients">broken_sasl_auth_clients</a> (no)</b>
-              Enable  inter-operability  with  SMTP  clients that
-              implement an obsolete version of the  AUTH  command
+              Enable inter-operability  with  SMTP  clients  that
+              implement  an  obsolete version of the AUTH command
               (<a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a>).
 
        <b><a href="postconf.5.html#smtpd_sasl_auth_enable">smtpd_sasl_auth_enable</a> (no)</b>
-              Enable  SASL  authentication  in  the  Postfix SMTP
+              Enable SASL  authentication  in  the  Postfix  SMTP
               server.
 
        <b><a href="postconf.5.html#smtpd_sasl_application_name">smtpd_sasl_application_name</a> (smtpd)</b>
-              The application name used for SASL server  initial-
+              The  application name used for SASL server initial-
               ization.
 
        <b><a href="postconf.5.html#smtpd_sasl_local_domain">smtpd_sasl_local_domain</a> (empty)</b>
@@ -206,69 +200,69 @@ SMTPD(8)                                                 SMTPD(8)
               SMTP server will offer to the client.
 
        <b><a href="postconf.5.html#smtpd_sender_login_maps">smtpd_sender_login_maps</a> (empty)</b>
-              Optional lookup table with  the  SASL  login  names
+              Optional  lookup  table  with  the SASL login names
               that own sender (MAIL FROM) addresses.
 
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtpd_sasl_exceptions_networks">smtpd_sasl_exceptions_networks</a> (empty)</b>
-              What  SMTP clients Postfix will not offer AUTH sup-
+              What SMTP clients Postfix will not offer AUTH  sup-
               port to.
 
 <b>VERP SUPPORT CONTROLS</b>
-       With VERP style delivery,  each  recipient  of  a  message
+       With  VERP  style  delivery,  each  recipient of a message
        receives a customized copy of the message with his/her own
-       recipient address encoded in the envelope sender  address.
+       recipient  address encoded in the envelope sender address.
        The <a href="VERP_README.html">VERP_README</a> file describes configuration and operation
-       details of Postfix support for  variable  envelope  return
+       details  of  Postfix  support for variable envelope return
        path addresses.  VERP style delivery is requested with the
-       SMTP XVERP command or with the "sendmail -V"  command-line
-       option  and is available in Postfix version 1.1 and later.
+       SMTP  XVERP command or with the "sendmail -V" command-line
+       option and is available in Postfix version 1.1 and  later.
 
        <b><a href="postconf.5.html#default_verp_delimiters">default_verp_delimiters</a> (+=)</b>
               The two default VERP delimiter characters.
 
        <b><a href="postconf.5.html#verp_delimiter_filter">verp_delimiter_filter</a> (-=+)</b>
-              The characters Postfix accepts  as  VERP  delimiter
-              characters  on the Postfix <a href="sendmail.1.html">sendmail(1)</a> command line
+              The  characters  Postfix  accepts as VERP delimiter
+              characters on the Postfix <a href="sendmail.1.html">sendmail(1)</a> command  line
               and in SMTP commands.
 
        Available in Postfix version 1.1 and 2.0:
 
        <b><a href="postconf.5.html#authorized_verp_clients">authorized_verp_clients</a> ($<a href="postconf.5.html#mynetworks">mynetworks</a>)</b>
-              What SMTP clients are allowed to specify the  XVERP
+              What  SMTP clients are allowed to specify the XVERP
               command.
 
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtpd_authorized_verp_clients">smtpd_authorized_verp_clients</a> ($<a href="postconf.5.html#authorized_verp_clients">authorized_verp_clients</a>)</b>
-              What  SMTP clients are allowed to specify the XVERP
+              What SMTP clients are allowed to specify the  XVERP
               command.
 
 <b>TROUBLE SHOOTING CONTROLS</b>
-       The <a href="DEBUG_README.html">DEBUG_README</a> document describes how to debug parts  of
-       the  Postfix mail system. The methods vary from making the
-       software log a lot of detail, to running some daemon  pro-
+       The  <a href="DEBUG_README.html">DEBUG_README</a> document describes how to debug parts of
+       the Postfix mail system. The methods vary from making  the
+       software  log a lot of detail, to running some daemon pro-
        cesses under control of a call tracer or debugger.
 
        <b><a href="postconf.5.html#debug_peer_level">debug_peer_level</a> (2)</b>
-              The  increment  in  verbose  logging  level  when a
-              remote client or server matches a  pattern  in  the
+              The increment  in  verbose  logging  level  when  a
+              remote  client  or  server matches a pattern in the
               <a href="postconf.5.html#debug_peer_list">debug_peer_list</a> parameter.
 
        <b><a href="postconf.5.html#debug_peer_list">debug_peer_list</a> (empty)</b>
-              Optional  list  of remote client or server hostname
-              or network address patterns that cause the  verbose
-              logging  level  to increase by the amount specified
+              Optional list of remote client or  server  hostname
+              or  network address patterns that cause the verbose
+              logging level to increase by the  amount  specified
               in $<a href="postconf.5.html#debug_peer_level">debug_peer_level</a>.
 
        <b><a href="postconf.5.html#error_notice_recipient">error_notice_recipient</a> (postmaster)</b>
-              The recipient  of  postmaster  notifications  about
-              mail  delivery  problems that are caused by policy,
+              The  recipient  of  postmaster  notifications about
+              mail delivery problems that are caused  by  policy,
               resource, software or protocol errors.
 
        <b><a href="postconf.5.html#notify_classes">notify_classes</a> (resource, software)</b>
-              The list of error classes that are reported to  the
+              The  list of error classes that are reported to the
               postmaster.
 
        <b><a href="postconf.5.html#soft_bounce">soft_bounce</a> (no)</b>
@@ -278,22 +272,22 @@ SMTPD(8)                                                 SMTPD(8)
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtpd_authorized_xclient_hosts">smtpd_authorized_xclient_hosts</a> (empty)</b>
-              What SMTP clients are allowed to  use  the  XCLIENT
+              What  SMTP  clients  are allowed to use the XCLIENT
               feature.
 
 <b>KNOWN VERSUS UNKNOWN RECIPIENT CONTROLS</b>
-       As  of  Postfix  version 2.0, the SMTP server rejects mail
-       for unknown recipients. This prevents the mail queue  from
-       clogging  up  with  undeliverable  MAILER-DAEMON messages.
-       Additional  information  on   this   topic   is   in   the
+       As of Postfix version 2.0, the SMTP  server  rejects  mail
+       for  unknown recipients. This prevents the mail queue from
+       clogging up  with  undeliverable  MAILER-DAEMON  messages.
+       Additional   information   on   this   topic   is  in  the
        <a href="LOCAL_RECIPIENT_README.html">LOCAL_RECIPIENT_README</a> and <a href="ADDRESS_CLASS_README.html">ADDRESS_CLASS_README</a> documents.
 
        <b><a href="postconf.5.html#show_user_unknown_table_name">show_user_unknown_table_name</a> (yes)</b>
-              Display the name of  the  recipient  table  in  the
+              Display  the  name  of  the  recipient table in the
               "User unknown" responses.
 
        <b><a href="postconf.5.html#canonical_maps">canonical_maps</a> (empty)</b>
-              Optional  address mapping lookup tables for message
+              Optional address mapping lookup tables for  message
               headers and envelopes.
 
        <b><a href="postconf.5.html#recipient_canonical_maps">recipient_canonical_maps</a> (empty)</b>
@@ -304,7 +298,7 @@ SMTPD(8)                                                 SMTPD(8)
 
        <b><a href="postconf.5.html#mydestination">mydestination</a>  ($<a href="postconf.5.html#myhostname">myhostname</a>,  localhost.$<a href="postconf.5.html#mydomain">mydomain</a>,  local-</b>
        <b>host)</b>
-              The  list  of  domains  that  are delivered via the
+              The list of domains  that  are  delivered  via  the
               $<a href="postconf.5.html#local_transport">local_transport</a> mail delivery transport.
 
        <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> (all)</b>
@@ -313,185 +307,185 @@ SMTPD(8)                                                 SMTPD(8)
 
        <b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> (empty)</b>
               The network interface addresses that this mail sys-
-              tem receives mail on by way of a proxy  or  network
+              tem  receives  mail on by way of a proxy or network
               address translation unit.
 
        <b><a href="postconf.5.html#local_recipient_maps">local_recipient_maps</a>             (<a href="proxymap.8.html">proxy</a>:unix:passwd.byname</b>
        <b>$<a href="postconf.5.html#alias_maps">alias_maps</a>)</b>
-              Lookup  tables with all names or addresses of local
-              recipients: a recipient address is local  when  its
-              domain  matches $<a href="postconf.5.html#mydestination">mydestination</a>, $<a href="postconf.5.html#inet_interfaces">inet_interfaces</a> or
+              Lookup tables with all names or addresses of  local
+              recipients:  a  recipient address is local when its
+              domain matches $<a href="postconf.5.html#mydestination">mydestination</a>, $<a href="postconf.5.html#inet_interfaces">inet_interfaces</a>  or
               $<a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a>.
 
        <b><a href="postconf.5.html#unknown_local_recipient_reject_code">unknown_local_recipient_reject_code</a> (550)</b>
-              The numerical Postfix  SMTP  server  response  code
-              when    a   recipient   address   is   local,   and
-              $<a href="postconf.5.html#local_recipient_maps">local_recipient_maps</a> specifies a  list  of  lookup
+              The  numerical  Postfix  SMTP  server response code
+              when   a   recipient   address   is   local,    and
+              $<a href="postconf.5.html#local_recipient_maps">local_recipient_maps</a>  specifies  a  list of lookup
               tables that does not match the recipient.
 
-       Parameters  concerning  known/unknown  recipients of relay
+       Parameters concerning known/unknown  recipients  of  relay
        destinations:
 
        <b><a href="postconf.5.html#relay_domains">relay_domains</a> ($<a href="postconf.5.html#mydestination">mydestination</a>)</b>
-              What destination domains (and  subdomains  thereof)
+              What  destination  domains (and subdomains thereof)
               this system will relay mail to.
 
        <b><a href="postconf.5.html#relay_recipient_maps">relay_recipient_maps</a> (empty)</b>
-              Optional  lookup tables with all valid addresses in
+              Optional lookup tables with all valid addresses  in
               the domains that match $<a href="postconf.5.html#relay_domains">relay_domains</a>.
 
        <b><a href="postconf.5.html#unknown_relay_recipient_reject_code">unknown_relay_recipient_reject_code</a> (550)</b>
               The numerical Postfix SMTP server reply code when a
-              recipient   address   matches  $<a href="postconf.5.html#relay_domains">relay_domains</a>,  and
-              <a href="postconf.5.html#relay_recipient_maps">relay_recipient_maps</a> specifies  a  list  of  lookup
+              recipient  address  matches   $<a href="postconf.5.html#relay_domains">relay_domains</a>,   and
+              <a href="postconf.5.html#relay_recipient_maps">relay_recipient_maps</a>  specifies  a  list  of lookup
               tables that does not match the recipient address.
 
-       Parameters  concerning known/unknown recipients in virtual
+       Parameters concerning known/unknown recipients in  virtual
        alias domains:
 
        <b><a href="postconf.5.html#virtual_alias_domains">virtual_alias_domains</a> ($<a href="postconf.5.html#virtual_alias_maps">virtual_alias_maps</a>)</b>
               Postfix is final destination for the specified list
-              of  virtual  alias  domains,  that  is, domains for
-              which all addresses are  aliased  to  addresses  in
+              of virtual alias  domains,  that  is,  domains  for
+              which  all  addresses  are  aliased to addresses in
               other local or remote domains.
 
        <b><a href="postconf.5.html#virtual_alias_maps">virtual_alias_maps</a> ($<a href="postconf.5.html#virtual_maps">virtual_maps</a>)</b>
-              Optional  lookup  tables  that  alias specific mail
-              addresses or  domains  to  other  local  or  remote
+              Optional lookup tables  that  alias  specific  mail
+              addresses  or  domains  to  other  local  or remote
               address.
 
        <b><a href="postconf.5.html#unknown_virtual_alias_reject_code">unknown_virtual_alias_reject_code</a> (550)</b>
               The SMTP server reply code when a recipient address
-              matches    $<a href="postconf.5.html#virtual_alias_domains">virtual_alias_domains</a>,    and     $<a href="postconf.5.html#virtual_alias_maps">vir</a>-
-              <a href="postconf.5.html#virtual_alias_maps">tual_alias_maps</a>  specifies  a list of lookup tables
+              matches     $<a href="postconf.5.html#virtual_alias_domains">virtual_alias_domains</a>,    and    $<a href="postconf.5.html#virtual_alias_maps">vir</a>-
+              <a href="postconf.5.html#virtual_alias_maps">tual_alias_maps</a> specifies a list of  lookup  tables
               that does not match the recipient address.
 
-       Parameters concerning known/unknown recipients in  virtual
+       Parameters  concerning known/unknown recipients in virtual
        mailbox domains:
 
        <b><a href="postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains</a> ($<a href="postconf.5.html#virtual_mailbox_maps">virtual_mailbox_maps</a>)</b>
               Postfix is final destination for the specified list
-              of  domains;  mail  is  delivered  via  the   $<a href="postconf.5.html#virtual_transport">vir</a>-
+              of   domains;  mail  is  delivered  via  the  $<a href="postconf.5.html#virtual_transport">vir</a>-
               <a href="postconf.5.html#virtual_transport">tual_transport</a> mail delivery transport.
 
        <b><a href="postconf.5.html#virtual_mailbox_maps">virtual_mailbox_maps</a> (empty)</b>
-              Optional  lookup tables with all valid addresses in
+              Optional lookup tables with all valid addresses  in
               the domains that match $<a href="postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains</a>.
 
        <b><a href="postconf.5.html#unknown_virtual_mailbox_reject_code">unknown_virtual_mailbox_reject_code</a> (550)</b>
               The SMTP server reply code when a recipient address
-              matches    $<a href="postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains</a>,    and   $<a href="postconf.5.html#virtual_mailbox_maps">vir</a>-
+              matches   $<a href="postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains</a>,    and    $<a href="postconf.5.html#virtual_mailbox_maps">vir</a>-
               <a href="postconf.5.html#virtual_mailbox_maps">tual_mailbox_maps</a> specifies a list of lookup tables
               that does not match the recipient address.
 
 <b>RESOURCE AND RATE CONTROLS</b>
-       The  following parameters limit resource usage by the SMTP
+       The following parameters limit resource usage by the  SMTP
        server and/or control client request rates.
 
        <b><a href="postconf.5.html#line_length_limit">line_length_limit</a> (2048)</b>
-              Upon input, long lines are chopped up  into  pieces
-              of  at  most this length; upon delivery, long lines
+              Upon  input,  long lines are chopped up into pieces
+              of at most this length; upon delivery,  long  lines
               are reconstructed.
 
        <b><a href="postconf.5.html#queue_minfree">queue_minfree</a> (0)</b>
-              The minimal amount of free space in  bytes  in  the
+              The  minimal  amount  of free space in bytes in the
               queue file system that is needed to receive mail.
 
        <b><a href="postconf.5.html#message_size_limit">message_size_limit</a> (10240000)</b>
-              The  maximal  size in bytes of a message, including
+              The maximal size in bytes of a  message,  including
               envelope information.
 
        <b><a href="postconf.5.html#smtpd_recipient_limit">smtpd_recipient_limit</a> (1000)</b>
-              The maximal number of recipients that  the  Postfix
+              The  maximal  number of recipients that the Postfix
               SMTP server accepts per message delivery request.
 
        <b><a href="postconf.5.html#smtpd_timeout">smtpd_timeout</a> (300s)</b>
-              The  time  limit  for sending a Postfix SMTP server
-              response and for receiving  a  remote  SMTP  client
+              The time limit for sending a  Postfix  SMTP  server
+              response  and  for  receiving  a remote SMTP client
               request.
 
        <b><a href="postconf.5.html#smtpd_history_flush_threshold">smtpd_history_flush_threshold</a> (100)</b>
-              The  maximal  number  of  lines in the Postfix SMTP
-              server command history before it  is  flushed  upon
+              The maximal number of lines  in  the  Postfix  SMTP
+              server  command  history  before it is flushed upon
               receipt of EHLO, RSET, or end of DATA.
 
        The per SMTP client connection count and request rate lim-
        its are implemented in co-operation with the <a href="anvil.8.html">anvil(8)</a> ser-
-       vice,  and are available in Postfix version 2.2 and later.
+       vice, and are available in Postfix version 2.2 and  later.
 
        <b><a href="postconf.5.html#smtpd_client_connection_count_limit">smtpd_client_connection_count_limit</a> (50)</b>
-              How many simultaneous  connections  any  client  is
+              How  many  simultaneous  connections  any client is
               allowed to make to this service.
 
        <b><a href="postconf.5.html#smtpd_client_connection_rate_limit">smtpd_client_connection_rate_limit</a> (0)</b>
               The  maximal  number  of  connection  attempts  any
-              client is allowed to make to this service per  time
+              client  is allowed to make to this service per time
               unit.
 
        <b><a href="postconf.5.html#smtpd_client_message_rate_limit">smtpd_client_message_rate_limit</a> (0)</b>
-              The  maximal  number  of  message delivery requests
-              that any client is allowed to make to this  service
+              The maximal number  of  message  delivery  requests
+              that  any client is allowed to make to this service
               per time unit, regardless of whether or not Postfix
               actually accepts those messages.
 
        <b><a href="postconf.5.html#smtpd_client_recipient_rate_limit">smtpd_client_recipient_rate_limit</a> (0)</b>
-              The maximal number of recipient addresses that  any
-              client  is allowed to send to this service per time
+              The  maximal number of recipient addresses that any
+              client is allowed to send to this service per  time
               unit, regardless of whether or not Postfix actually
               accepts those recipients.
 
        <b><a href="postconf.5.html#smtpd_client_event_limit_exceptions">smtpd_client_event_limit_exceptions</a> ($<a href="postconf.5.html#mynetworks">mynetworks</a>)</b>
-              Clients  that  are  excluded from connection count,
-              connection rate, message  rate  or  recipient  rate
+              Clients that are excluded  from  connection  count,
+              connection  rate,  message  rate  or recipient rate
               restrictions.
 
 <b>TARPIT CONTROLS</b>
-       When  a  remote SMTP client makes errors, the Postfix SMTP
-       server can insert delays before responding. This can  help
-       to  slow  down  run-away  software.   The behavior is con-
-       trolled by an error counter  that  counts  the  number  of
-       errors  within an SMTP session that a client makes without
+       When a remote SMTP client makes errors, the  Postfix  SMTP
+       server  can insert delays before responding. This can help
+       to slow down run-away  software.   The  behavior  is  con-
+       trolled  by  an  error  counter  that counts the number of
+       errors within an SMTP session that a client makes  without
        delivering mail.
 
        <b><a href="postconf.5.html#smtpd_error_sleep_time">smtpd_error_sleep_time</a> (1s)</b>
-              With  Postfix  2.1  and  later:  the  SMTP   server
-              response  delay  after  a client has made more than
-              $<a href="postconf.5.html#smtpd_soft_error_limit">smtpd_soft_error_limit</a>  errors,  and  fewer   than
-              $<a href="postconf.5.html#smtpd_hard_error_limit">smtpd_hard_error_limit</a>  errors, without delivering
+              With   Postfix  2.1  and  later:  the  SMTP  server
+              response delay after a client has  made  more  than
+              $<a href="postconf.5.html#smtpd_soft_error_limit">smtpd_soft_error_limit</a>   errors,  and  fewer  than
+              $<a href="postconf.5.html#smtpd_hard_error_limit">smtpd_hard_error_limit</a> errors, without  delivering
               mail.
 
        <b><a href="postconf.5.html#smtpd_soft_error_limit">smtpd_soft_error_limit</a> (10)</b>
-              The number  of  errors  a  remote  SMTP  client  is
-              allowed  to make without delivering mail before the
+              The  number  of  errors  a  remote  SMTP  client is
+              allowed to make without delivering mail before  the
               Postfix SMTP server slows down all its responses.
 
        <b><a href="postconf.5.html#smtpd_hard_error_limit">smtpd_hard_error_limit</a> (20)</b>
-              The maximal number of errors a remote  SMTP  client
+              The  maximal  number of errors a remote SMTP client
               is allowed to make without delivering mail.
 
        <b><a href="postconf.5.html#smtpd_junk_command_limit">smtpd_junk_command_limit</a> (100)</b>
-              The  number  of  junk commands (NOOP, VRFY, ETRN or
+              The number of junk commands (NOOP,  VRFY,  ETRN  or
               RSET) that a remote SMTP client can send before the
-              Postfix  SMTP  server starts to increment the error
+              Postfix SMTP server starts to increment  the  error
               counter with each junk command.
 
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtpd_recipient_overshoot_limit">smtpd_recipient_overshoot_limit</a> (1000)</b>
-              The number of recipients that a remote SMTP  client
-              can  send  in  excess  of  the limit specified with
+              The  number of recipients that a remote SMTP client
+              can send in excess  of  the  limit  specified  with
               $<a href="postconf.5.html#smtpd_recipient_limit">smtpd_recipient_limit</a>,  before  the  Postfix  SMTP
-              server  increments  the per-session error count for
+              server increments the per-session error  count  for
               each excess recipient.
 
 <b>ACCESS POLICY DELEGATION CONTROLS</b>
-       As of version 2.1, Postfix can be configured  to  delegate
-       access  policy  decisions  to an external server that runs
-       outside Postfix.  See  the  file  <a href="SMTPD_POLICY_README.html">SMTPD_POLICY_README</a>  for
+       As  of  version 2.1, Postfix can be configured to delegate
+       access policy decisions to an external  server  that  runs
+       outside  Postfix.   See  the  file <a href="SMTPD_POLICY_README.html">SMTPD_POLICY_README</a> for
        more information.
 
        <b><a href="postconf.5.html#smtpd_policy_service_max_idle">smtpd_policy_service_max_idle</a> (300s)</b>
-              The  time  after which an idle SMTPD policy service
+              The time after which an idle SMTPD  policy  service
               connection is closed.
 
        <b><a href="postconf.5.html#smtpd_policy_service_max_ttl">smtpd_policy_service_max_ttl</a> (1000s)</b>
@@ -499,154 +493,154 @@ SMTPD(8)                                                 SMTPD(8)
               connection is closed.
 
        <b><a href="postconf.5.html#smtpd_policy_service_timeout">smtpd_policy_service_timeout</a> (100s)</b>
-              The  time  limit  for  connecting to, writing to or
+              The time limit for connecting  to,  writing  to  or
               receiving from a delegated SMTPD policy server.
 
 <b>ACCESS CONTROLS</b>
-       The <a href="SMTPD_ACCESS_README.html">SMTPD_ACCESS_README</a> document gives an introduction  to
+       The  <a href="SMTPD_ACCESS_README.html">SMTPD_ACCESS_README</a> document gives an introduction to
        all the SMTP server access control features.
 
        <b><a href="postconf.5.html#smtpd_delay_reject">smtpd_delay_reject</a> (yes)</b>
-              Wait  until  the  RCPT TO command before evaluating
+              Wait until the RCPT TO  command  before  evaluating
               $<a href="postconf.5.html#smtpd_client_restrictions">smtpd_client_restrictions</a>,    $smtpd_helo_restric-
               tions and $<a href="postconf.5.html#smtpd_sender_restrictions">smtpd_sender_restrictions</a>, or wait until
-              the     ETRN     command     before      evaluating
+              the      ETRN     command     before     evaluating
               $<a href="postconf.5.html#smtpd_client_restrictions">smtpd_client_restrictions</a> and $smtpd_helo_restric-
               tions.
 
-       <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a> (see 'postconf  -d'  out-</b>
+       <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a>  (see  'postconf -d' out-</b>
        <b>put)</b>
               What   Postfix   features   match   subdomains   of
               "domain.tld" automatically, instead of requiring an
               explicit ".domain.tld" pattern.
 
        <b><a href="postconf.5.html#smtpd_client_restrictions">smtpd_client_restrictions</a> (empty)</b>
-              Optional SMTP server  access  restrictions  in  the
+              Optional  SMTP  server  access  restrictions in the
               context of a client SMTP connection request.
 
        <b><a href="postconf.5.html#smtpd_helo_required">smtpd_helo_required</a> (no)</b>
               Require that a remote SMTP client introduces itself
-              at the beginning of an SMTP session with  the  HELO
+              at  the  beginning of an SMTP session with the HELO
               or EHLO command.
 
        <b><a href="postconf.5.html#smtpd_helo_restrictions">smtpd_helo_restrictions</a> (empty)</b>
-              Optional  restrictions that the Postfix SMTP server
+              Optional restrictions that the Postfix SMTP  server
               applies in the context of the SMTP HELO command.
 
        <b><a href="postconf.5.html#smtpd_sender_restrictions">smtpd_sender_restrictions</a> (empty)</b>
-              Optional restrictions that the Postfix SMTP  server
+              Optional  restrictions that the Postfix SMTP server
               applies in the context of the MAIL FROM command.
 
        <b><a href="postconf.5.html#smtpd_recipient_restrictions">smtpd_recipient_restrictions</a>           (<a href="postconf.5.html#permit_mynetworks">permit_mynetworks</a>,</b>
        <b><a href="postconf.5.html#reject_unauth_destination">reject_unauth_destination</a>)</b>
               The  access  restrictions  that  the  Postfix  SMTP
-              server applies in the context of the RCPT  TO  com-
+              server  applies  in the context of the RCPT TO com-
               mand.
 
        <b><a href="postconf.5.html#smtpd_etrn_restrictions">smtpd_etrn_restrictions</a> (empty)</b>
-              Optional  SMTP  server  access  restrictions in the
+              Optional SMTP server  access  restrictions  in  the
               context of a client ETRN request.
 
        <b><a href="postconf.5.html#allow_untrusted_routing">allow_untrusted_routing</a> (no)</b>
-              Forward   mail   with   sender-specified    routing
-              (user[@%!]remote[@%!]site)  from  untrusted clients
+              Forward    mail   with   sender-specified   routing
+              (user[@%!]remote[@%!]site) from  untrusted  clients
               to destinations matching $<a href="postconf.5.html#relay_domains">relay_domains</a>.
 
        <b><a href="postconf.5.html#smtpd_restriction_classes">smtpd_restriction_classes</a> (empty)</b>
-              User-defined aliases for groups of access  restric-
+              User-defined  aliases for groups of access restric-
               tions.
 
        <b><a href="postconf.5.html#smtpd_null_access_lookup_key">smtpd_null_access_lookup_key</a> (</b>&lt;&gt;<b>)</b>
-              The  lookup key to be used in SMTP <a href="access.5.html">access(5)</a> tables
+              The lookup key to be used in SMTP <a href="access.5.html">access(5)</a>  tables
               instead of the null sender address.
 
        <b><a href="postconf.5.html#permit_mx_backup_networks">permit_mx_backup_networks</a> (empty)</b>
               Restrict  the  use  of  the  <a href="postconf.5.html#permit_mx_backup">permit_mx_backup</a>  SMTP
-              access  feature  to  only  domains whose primary MX
+              access feature to only  domains  whose  primary  MX
               hosts match the listed networks.
 
        Available in Postfix version 2.0 and later:
 
        <b><a href="postconf.5.html#smtpd_data_restrictions">smtpd_data_restrictions</a> (empty)</b>
-              Optional access restrictions that the Postfix  SMTP
+              Optional  access restrictions that the Postfix SMTP
               server applies in the context of the SMTP DATA com-
               mand.
 
        <b><a href="postconf.5.html#smtpd_expansion_filter">smtpd_expansion_filter</a> (see 'postconf -d' output)</b>
-              What characters are allowed in $name expansions  of
+              What  characters are allowed in $name expansions of
               RBL reply templates.
 
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtpd_reject_unlisted_sender">smtpd_reject_unlisted_sender</a> (no)</b>
-              Request  that  the Postfix SMTP server rejects mail
-              from  unknown  sender  addresses,  even   when   no
-              explicit  <a href="postconf.5.html#reject_unlisted_sender">reject_unlisted_sender</a> access restriction
+              Request that the Postfix SMTP server  rejects  mail
+              from   unknown   sender  addresses,  even  when  no
+              explicit <a href="postconf.5.html#reject_unlisted_sender">reject_unlisted_sender</a> access  restriction
               is specified.
 
        <b><a href="postconf.5.html#smtpd_reject_unlisted_recipient">smtpd_reject_unlisted_recipient</a> (yes)</b>
-              Request that the Postfix SMTP server  rejects  mail
+              Request  that  the Postfix SMTP server rejects mail
               for  unknown  recipient  addresses,  even  when  no
-              explicit <a href="postconf.5.html#reject_unlisted_recipient">reject_unlisted_recipient</a> access  restric-
+              explicit  <a href="postconf.5.html#reject_unlisted_recipient">reject_unlisted_recipient</a> access restric-
               tion is specified.
 
 <b>SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS</b>
-       Postfix   version  2.1  introduces  sender  and  recipient
-       address verification.   This  feature  is  implemented  by
-       sending  probe email messages that are not actually deliv-
-       ered.  This feature is requested  via  the  <a href="postconf.5.html#reject_unverified_sender">reject_unveri</a>-
-       <a href="postconf.5.html#reject_unverified_sender">fied_sender</a>    and    <a href="postconf.5.html#reject_unverified_recipient">reject_unverified_recipient</a>   access
-       restrictions.  The status of verification probes is  main-
+       Postfix  version  2.1  introduces  sender  and   recipient
+       address  verification.   This  feature  is  implemented by
+       sending probe email messages that are not actually  deliv-
+       ered.   This  feature  is requested via the <a href="postconf.5.html#reject_unverified_sender">reject_unveri</a>-
+       <a href="postconf.5.html#reject_unverified_sender">fied_sender</a>   and    <a href="postconf.5.html#reject_unverified_recipient">reject_unverified_recipient</a>    access
+       restrictions.   The status of verification probes is main-
        tained by the <a href="verify.8.html">verify(8)</a> server.  See the file ADDRESS_VER-
-       <a href="IFICATION_README.html">IFICATION_README</a> for information about  how  to  configure
+       <a href="IFICATION_README.html">IFICATION_README</a>  for  information  about how to configure
        and operate the Postfix sender/recipient address verifica-
        tion service.
 
        <b><a href="postconf.5.html#address_verify_poll_count">address_verify_poll_count</a> (3)</b>
-              How many times to query the <a href="verify.8.html">verify(8)</a>  service  for
-              the  completion  of an address verification request
+              How  many  times to query the <a href="verify.8.html">verify(8)</a> service for
+              the completion of an address  verification  request
               in progress.
 
        <b><a href="postconf.5.html#address_verify_poll_delay">address_verify_poll_delay</a> (3s)</b>
-              The delay between queries for the completion of  an
+              The  delay between queries for the completion of an
               address verification request in progress.
 
        <b><a href="postconf.5.html#address_verify_sender">address_verify_sender</a> (postmaster)</b>
-              The  sender  address to use in address verification
+              The sender address to use in  address  verification
               probes.
 
        <b><a href="postconf.5.html#unverified_sender_reject_code">unverified_sender_reject_code</a> (450)</b>
-              The numerical Postfix  SMTP  server  response  code
-              when   a  recipient  address  is  rejected  by  the
+              The  numerical  Postfix  SMTP  server response code
+              when  a  recipient  address  is  rejected  by   the
               <a href="postconf.5.html#reject_unverified_sender">reject_unverified_sender</a> restriction.
 
        <b><a href="postconf.5.html#unverified_recipient_reject_code">unverified_recipient_reject_code</a> (450)</b>
-              The numerical Postfix SMTP server response  when  a
+              The  numerical  Postfix SMTP server response when a
               recipient address is rejected by the <a href="postconf.5.html#reject_unverified_recipient">reject_unveri</a>-
               <a href="postconf.5.html#reject_unverified_recipient">fied_recipient</a> restriction.
 
 <b>ACCESS CONTROL RESPONSES</b>
-       The following  parameters  control  numerical  SMTP  reply
+       The  following  parameters  control  numerical  SMTP reply
        codes and/or text responses.
 
        <b><a href="postconf.5.html#access_map_reject_code">access_map_reject_code</a> (554)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when a client  is  rejected  by  an  <a href="access.5.html">access(5)</a>  map
+              The numerical Postfix  SMTP  server  response  code
+              when  a  client  is  rejected  by  an <a href="access.5.html">access(5)</a> map
               restriction.
 
        <b><a href="postconf.5.html#defer_code">defer_code</a> (450)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when a remote SMTP client request  is  rejected  by
+              The numerical Postfix  SMTP  server  response  code
+              when  a  remote  SMTP client request is rejected by
               the "defer" restriction.
 
        <b><a href="postconf.5.html#invalid_hostname_reject_code">invalid_hostname_reject_code</a> (501)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when the client HELO or EHLO command  parameter  is
-              rejected  by  the  <a href="postconf.5.html#reject_invalid_hostname">reject_invalid_hostname</a> restric-
+              The numerical Postfix  SMTP  server  response  code
+              when  the  client HELO or EHLO command parameter is
+              rejected by  the  <a href="postconf.5.html#reject_invalid_hostname">reject_invalid_hostname</a>  restric-
               tion.
 
        <b><a href="postconf.5.html#maps_rbl_reject_code">maps_rbl_reject_code</a> (554)</b>
-              The numerical Postfix  SMTP  server  response  code
+              The  numerical  Postfix  SMTP  server response code
               when a remote SMTP client request is blocked by the
               <a href="postconf.5.html#reject_rbl_client">reject_rbl_client</a>,             <a href="postconf.5.html#reject_rhsbl_client">reject_rhsbl_client</a>,
               <a href="postconf.5.html#reject_rhsbl_sender">reject_rhsbl_sender</a>    or    <a href="postconf.5.html#reject_rhsbl_recipient">reject_rhsbl_recipient</a>
@@ -654,47 +648,47 @@ SMTPD(8)                                                 SMTPD(8)
 
        <b><a href="postconf.5.html#non_fqdn_reject_code">non_fqdn_reject_code</a> (504)</b>
               The numerical Postfix SMTP server reply code when a
-              client     request     is     rejected    by    the
+              client    request    is     rejected     by     the
               <a href="postconf.5.html#reject_non_fqdn_hostname">reject_non_fqdn_hostname</a>, <a href="postconf.5.html#reject_non_fqdn_sender">reject_non_fqdn_sender</a> or
               <a href="postconf.5.html#reject_non_fqdn_recipient">reject_non_fqdn_recipient</a> restriction.
 
        <b><a href="postconf.5.html#reject_code">reject_code</a> (554)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when a remote SMTP client request  is  rejected  by
+              The numerical Postfix  SMTP  server  response  code
+              when  a  remote  SMTP client request is rejected by
               the "<b>reject</b>" restriction.
 
        <b><a href="postconf.5.html#relay_domains_reject_code">relay_domains_reject_code</a> (554)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when  a  client  request   is   rejected   by   the
+              The numerical Postfix  SMTP  server  response  code
+              when   a   client   request   is  rejected  by  the
               <a href="postconf.5.html#reject_unauth_destination">reject_unauth_destination</a> recipient restriction.
 
        <b><a href="postconf.5.html#unknown_address_reject_code">unknown_address_reject_code</a> (450)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when a sender or recipient address is  rejected  by
+              The numerical Postfix  SMTP  server  response  code
+              when  a  sender or recipient address is rejected by
               the         <a href="postconf.5.html#reject_unknown_sender_domain">reject_unknown_sender_domain</a>         or
               <a href="postconf.5.html#reject_unknown_recipient_domain">reject_unknown_recipient_domain</a> restriction.
 
        <b><a href="postconf.5.html#unknown_client_reject_code">unknown_client_reject_code</a> (450)</b>
-              The numerical Postfix  SMTP  server  response  code
-              when  a  client without valid address &lt;=&gt; name map-
-              ping  is  rejected  by  the   <a href="postconf.5.html#reject_unknown_client">reject_unknown_client</a>
+              The  numerical  Postfix  SMTP  server response code
+              when a client without valid address &lt;=&gt;  name  map-
+              ping   is  rejected  by  the  <a href="postconf.5.html#reject_unknown_client">reject_unknown_client</a>
               restriction.
 
        <b><a href="postconf.5.html#unknown_hostname_reject_code">unknown_hostname_reject_code</a> (450)</b>
-              The  numerical  Postfix  SMTP  server response code
-              when the hostname specified with the HELO  or  EHLO
-              command  is rejected by the <a href="postconf.5.html#reject_unknown_hostname">reject_unknown_hostname</a>
+              The numerical Postfix  SMTP  server  response  code
+              when  the  hostname specified with the HELO or EHLO
+              command is rejected by the  <a href="postconf.5.html#reject_unknown_hostname">reject_unknown_hostname</a>
               restriction.
 
        Available in Postfix version 2.0 and later:
 
        <b><a href="postconf.5.html#default_rbl_reply">default_rbl_reply</a> (see 'postconf -d' output)</b>
-              The default SMTP server  response  template  for  a
-              request  that  is rejected by an RBL-based restric-
+              The  default  SMTP  server  response template for a
+              request that is rejected by an  RBL-based  restric-
               tion.
 
        <b><a href="postconf.5.html#multi_recipient_bounce_reject_code">multi_recipient_bounce_reject_code</a> (550)</b>
-              The numerical Postfix  SMTP  server  response  code
+              The  numerical  Postfix  SMTP  server response code
               when a remote SMTP client request is blocked by the
               <a href="postconf.5.html#reject_multi_recipient_bounce">reject_multi_recipient_bounce</a> restriction.
 
@@ -703,16 +697,16 @@ SMTPD(8)                                                 SMTPD(8)
 
 <b>MISCELLANEOUS CONTROLS</b>
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The  default  location  of  the Postfix main.cf and
+              The default location of  the  Postfix  main.cf  and
               master.cf configuration files.
 
        <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
-              How much time a Postfix daemon process may take  to
-              handle  a  request  before  it  is  terminated by a
+              How  much time a Postfix daemon process may take to
+              handle a request  before  it  is  terminated  by  a
               built-in watchdog timer.
 
        <b><a href="postconf.5.html#command_directory">command_directory</a> (see 'postconf -d' output)</b>
-              The location of  all  postfix  administrative  com-
+              The  location  of  all  postfix administrative com-
               mands.
 
        <b><a href="postconf.5.html#double_bounce_sender">double_bounce_sender</a> (double-bounce)</b>
@@ -733,36 +727,36 @@ SMTPD(8)                                                 SMTPD(8)
               and most Postfix daemon processes.
 
        <b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
-              The maximum amount of time  that  an  idle  Postfix
-              daemon  process  waits for the next service request
+              The  maximum  amount  of  time that an idle Postfix
+              daemon process waits for the next  service  request
               before exiting.
 
        <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
-              The maximal number of connection requests before  a
+              The  maximal number of connection requests before a
               Postfix daemon process terminates.
 
        <b><a href="postconf.5.html#myhostname">myhostname</a> (see 'postconf -d' output)</b>
               The internet hostname of this mail system.
 
        <b><a href="postconf.5.html#mynetworks">mynetworks</a> (see 'postconf -d' output)</b>
-              The  list  of "trusted" SMTP clients that have more
+              The list of "trusted" SMTP clients that  have  more
               privileges than "strangers".
 
        <b><a href="postconf.5.html#myorigin">myorigin</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
               The domain name that locally-posted mail appears to
-              come  from,  and that locally posted mail is deliv-
+              come from, and that locally posted mail  is  deliv-
               ered to.
 
        <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
-              The process ID of a Postfix command or daemon  pro-
+              The  process ID of a Postfix command or daemon pro-
               cess.
 
        <b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
-              The  process  name  of  a Postfix command or daemon
+              The process name of a  Postfix  command  or  daemon
               process.
 
        <b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
-              The location of the Postfix top-level queue  direc-
+              The  location of the Postfix top-level queue direc-
               tory.
 
        <b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
@@ -770,14 +764,14 @@ SMTPD(8)                                                 SMTPD(8)
               sions (user+foo).
 
        <b><a href="postconf.5.html#smtpd_banner">smtpd_banner</a> ($<a href="postconf.5.html#myhostname">myhostname</a> ESMTP $<a href="postconf.5.html#mail_name">mail_name</a>)</b>
-              The text that follows the 220 status  code  in  the
+              The  text  that  follows the 220 status code in the
               SMTP greeting banner.
 
        <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
               The syslog facility of Postfix logging.
 
        <b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
-              The  mail system name that is prepended to the pro-
+              The mail system name that is prepended to the  pro-
               cess  name  in  syslog  records,  so  that  "smtpd"
               becomes, for example, "postfix/smtpd".
 
@@ -803,7 +797,7 @@ SMTPD(8)                                                 SMTPD(8)
        <a href="XFORWARD_README.html">XFORWARD_README</a>, Postfix XFORWARD extension
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>AUTHOR(S)</b>
index 36022a14a5f99302c7e91122591937231dbfc204..6c295cdb24e23a0c60040ee3e9da7a569d1a1db3 100644 (file)
@@ -32,12 +32,12 @@ TRIVIAL-REWRITE(8)                             TRIVIAL-REWRITE(8)
 
               <b>invalid</b>
                      Append   the   domain  name  specified  with
-                     <b>$<a href="postconf.5.html#invalid_header_rewrite_context_domain">invalid_header_rewrite_context_domain</a></b>    to
-                     incomplete  addresses.  Otherwise the result
-                     is identical to that of  the  <b>local</b>  address
-                     rewriting  context.  This  prevents  Postfix
-                     from appending the <a href="ADDRESS_CLASS_README.html#local_domain_class">local domain</a> to spam from
-                     poorly written remote clients.
+                     <b>$<a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a></b> to  incomplete
+                     addresses. Otherwise the result is identical
+                     to that of the <b>local</b> address rewriting  con-
+                     text.  This  prevents Postfix from appending
+                     the <a href="ADDRESS_CLASS_README.html#local_domain_class">local domain</a> to spam from poorly written
+                     remote clients.
 
        <b>resolve</b> <i>address</i>
               Resolve an address to a (<i>transport</i>, <i>nexthop</i>, <i>recip-</i>
@@ -135,18 +135,10 @@ TRIVIAL-REWRITE(8)                             TRIVIAL-REWRITE(8)
 
        Available in Postfix 2.2 and later:
 
-       <b><a href="postconf.5.html#invalid_header_rewrite_context_domain">invalid_header_rewrite_context_domain</a> (domain.invalid)</b>
+       <b><a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a> (domain.invalid)</b>
               Append  this  domain  to  incomplete message header
-              addresses     from     remote     clients,     when
-              $<a href="postconf.5.html#remote_header_rewrite_context_name">remote_header_rewrite_context_name</a>   is   set   to
-              "invalid".
-
-       Implemented by the <a href="smtpd.8.html">smtpd(8)</a> server:
-
-       <b><a href="postconf.5.html#remote_header_rewrite_context_name">remote_header_rewrite_context_name</a> (local)</b>
-              The address rewriting context that should  be  used
-              for  incomplete  mail  header addresses from remote
-              clients.
+              addresses from remote clients; when the  domain  is
+              empty, don't rewrite remote message headers at all.
 
 <b>ROUTING CONTROLS</b>
        The following is applicable to  Postfix  version  2.0  and
index ed6453d35b1c3f4069c0304f3244c4c97931dfb6..74e0f7c78ee8704e3bdad2bb3cf2703314a0a183 100644 (file)
@@ -360,14 +360,15 @@ The default time unit is s (seconds).
 .SH append_at_myorigin (default: yes)
 With locally submitted mail, append the string "@$myorigin" to mail
 addresses without domain information. With remotely submitted mail,
-append the string "@$invalid_domain" instead.
+append the string "@$remote_header_rewrite_domain" instead.
 .PP
 This feature is enabled by default and must not be turned off.
 Postfix does not support domain-less addresses.
 .SH append_dot_mydomain (default: yes)
 With locally submitted mail, append the string ".$mydomain" to
 addresses that have no ".domain" information. With remotely submitted
-mail, append the string ".$invalid_domain" instead.
+mail, append the string ".$remote_header_rewrite_domain"
+instead.
 .PP
 This feature is enabled by default. If disabled, users will not be
 able to send mail to "user@partialdomainname" but will have to
@@ -1308,11 +1309,6 @@ and via the pipe(8) and virtual(8) delivery agents.
 .PP
 Warning: with concurrency of 1, one bad message can be enough to
 block all mail to a site.
-.SH invalid_header_rewrite_context_domain (default: domain.invalid)
-Append this domain to incomplete message header addresses from
-remote clients, when $remote_header_rewrite_context_name is set to
-"invalid".  This is one way to avoid appending your own domain to
-addresses in spam from poorly written software.
 .SH invalid_hostname_reject_code (default: 501)
 The numerical Postfix SMTP server response code when the client
 HELO or EHLO command parameter is rejected by the reject_invalid_hostname
@@ -1564,32 +1560,46 @@ the entry in the master.cf file.
 Setting this parameter to a value > 1 changes the meaning of
 local_destination_concurrency_limit from concurrency per recipient
 into concurrency per domain.
-.SH local_header_rewrite_context_clients (default: $mynetworks)
-Append the domain names in $myorigin and $mydomain to incomplete
-message header addresses from these clients.
-.PP
-Specify a list of network addresses or network/netmask patterns,
-separated by comma or whitespace. Continue long lines by starting
-the next line with whitespace.
-.PP
-A network mask specifies the number of bits in the network part
-of a host address.  You can also specify "/file/name" or "type:table"
-patterns.  A "/file/name" pattern is replaced by its contents; a
-"type:table" lookup table is matched when a client name or address
-matches a lookup key (the lookup result is ignored).
-.PP
-The list is matched left to right, and the search stops on the
-first match.  Specify "!pattern" to exclude an address or network
-block from the list.
+.SH local_header_rewrite_clients (default: see "postconf -d" output)
+Append the domain name in $myorigin or $mydomain to incomplete
+message header addresses from these clients; append
+$remote_header_rewrite_domain for all other clients.
+.PP
+Specify a list of zero or more of the following:
+.IP "\fB permit_mynetworks \fR"
+Append the domain name in $myorigin or $mydomain when the
+client IP address matches any network or network address listed in
+$mynetworks. This is enabled by default.
+.IP "\fB permit_sasl_authenticated \fR"
+Append the domain name in $myorigin or $mydomain when the
+client is successfully authenticated via the RFC 2554 (AUTH)
+protocol. This is enabled by default.
+.IP "\fB permit_tls_clientcerts \fR"
+Append the domain name in $myorigin or $mydomain when the
+client TLS certificate is successfully verified, and the client
+certificate fingerprint is listed on the server. This is enabled
+by default.
+.IP "\fB permit_tls_all_clientcerts \fR"
+Append the domain name in $myorigin or $mydomain when the
+client TLS certificate is successfully verified, regardless of
+whether it is listed on the server, and regardless of the certifying
+authority.
+.IP "\fB check_address_map \fI<a
+href="DATABASE_README.html">type:table\fR \fR"
+.IP "\fB \fItype:table\fR
+\fR"
+Append the domain name in $myorigin or $mydomain when the
+client IP address matches the specified lookup table. The lookup
+result is ignored, and no subnet lookup is done. This is suitable
+for pop-before-smtp lookup tables.
 .PP
 Examples:
 .PP
 .nf
 .na
 .ft C
-local_header_rewrite_context_clients = $mynetworks
-local_header_rewrite_context_clients = !192.168.0.1 $mynetworks
-local_header_rewrite_context_clients = static:all
+local_header_rewrite_clients = static:all
+local_header_rewrite_clients = permit_mynetworks, permit_sasl_authenticated
 .fi
 .ad
 .ft R
@@ -2666,29 +2676,11 @@ relocated_maps = hash:/etc/postfix/relocated
 .fi
 .ad
 .ft R
-.SH remote_header_rewrite_context_name (default: local)
-The address rewriting context that should be used for incomplete
-mail header addresses from remote clients.
-.IP \(bu
-\fBlocal\fR Append the domains specified with $myorigin
-or $mydomain to incomplete message header addresses from remote
-clients.
-.IP \(bu
-\fBinvalid\fR Append the domain specified with
-$invalid_header_rewrite_context_domain to incomplete message header
-addresses from remote clients. This is one way to avoid appending
+.SH remote_header_rewrite_domain (default: domain.invalid)
+Append this domain name to incomplete message header addresses
+from remote clients; when this domain name is empty, don't rewrite
+remote message headers at all.  Both stop Postfix from appending
 your own domain to addresses in spam from poorly written software.
-This is a safe choice for gateways that have no control over
-address rewriting by down-stream systems.
-.IP \(bu
-\fBnone\fR Don't modify message headers from remote
-clients at all. This is another way to avoid appending your own
-domain to addresses in spam from poorly written software. This
-is the preferred choice for purists.
-.PP
-Note: Postfix always appends the domains specified with $myorigin
-or $mydomain to incomplete envelope addresses, because those
-addresses are effectively equivalent to local addresses.
 .SH require_home_directory (default: no)
 Whether or not a local(8) recipient's home directory must exist
 before mail delivery is attempted. By default this test is disabled.
@@ -3403,7 +3395,10 @@ parent domains, client IP address, or networks obtained by stripping
 least significant octets. See the access(5) manual page for details.
 .IP "\fBpermit_mynetworks\fR"
 Permit the request when the client IP address matches any
-network listed in  $mynetworks.
+network or network address listed in  $mynetworks.
+.IP "\fBpermit_sasl_authenticated\fR"
+Permit the request when the client is successfully
+authenticated via the RFC 2554 (AUTH) protocol.
 .IP "\fBreject_rbl_client \fIrbl_domain=d.d.d.d\fR\fR"
 Reject the request when the reversed client network address is
 listed with the A record "\fId.d.d.d\fR" under \fIrbl_domain\fR
index df282740453ee131998bd216672baa2eed6f851d..b78991467fa8c8b93108b5a9e751c466e6e7fede 100644 (file)
@@ -112,18 +112,14 @@ Enable or disable recipient validation, built-in content
 filtering, or address mapping.
 .PP
 Available in Postfix version 2.2 and later:
-.IP "\fBlocal_header_rewrite_context_clients ($mynetworks)\fR"
-Append the domain names in $myorigin and $mydomain to incomplete
-message header addresses from these clients.
-.IP "\fBremote_header_rewrite_context_name (local)\fR"
-The address rewriting context that should be used for incomplete
-mail header addresses from remote clients.
-.PP
-Implemented by the trivial-rewrite(8) server:
-.IP "\fBinvalid_header_rewrite_context_domain (domain.invalid)\fR"
-Append this domain to incomplete message header addresses from
-remote clients, when $remote_header_rewrite_context_name is set to
-"invalid".
+.IP "\fBlocal_header_rewrite_clients (see 'postconf -d' output)\fR"
+Append the domain name in $myorigin or $mydomain to incomplete
+message header addresses from these clients; append
+$remote_header_rewrite_domain for all other clients.
+.IP "\fBremote_header_rewrite_domain (domain.invalid)\fR"
+Append this domain name to incomplete message header addresses
+from remote clients; when this domain name is empty, don't rewrite
+remote message headers at all.
 .SH "AFTER QUEUE EXTERNAL CONTENT INSPECTION CONTROLS"
 .na
 .nf
index b73109e5a55e5045a0d098bf27554fd4788cc98b..79755bd30922530f9a9581b8f6f3e3265b1ab7b5 100644 (file)
@@ -27,7 +27,7 @@ strip source routed addresses (\fI@site,@site:user@domain\fR)
 to \fIuser@domain\fR form.
 .IP \fBinvalid\fR
 Append the domain name specified with
-\fB$invalid_header_rewrite_context_domain\fR to incomplete
+\fB$remote_header_rewrite_domain\fR to incomplete
 addresses. Otherwise the result is identical to that of
 the \fBlocal\fR address rewriting context. This prevents
 Postfix from appending the local domain to spam from poorly
@@ -127,15 +127,10 @@ The separator between user names and address extensions (user+foo).
 Enable the rewriting of "site!user" into "user@site".
 .PP
 Available in Postfix 2.2 and later:
-.IP "\fBinvalid_header_rewrite_context_domain (domain.invalid)\fR"
+.IP "\fBremote_header_rewrite_domain (domain.invalid)\fR"
 Append this domain to incomplete message header addresses from
-remote clients, when $remote_header_rewrite_context_name is set to
-"invalid".
-.PP
-Implemented by the smtpd(8) server:
-.IP "\fBremote_header_rewrite_context_name (local)\fR"
-The address rewriting context that should be used for incomplete
-mail header addresses from remote clients.
+remote clients; when the domain is empty, don't rewrite remote message
+headers at all.
 .SH "ROUTING CONTROLS"
 .na
 .nf
index e09b82ada7158eef133b9b63d6032d6e382b2683..4e1400e687cd38320f7e1fd20a7cb50bccaa9e99 100755 (executable)
@@ -183,7 +183,6 @@ while (<>) {
     s;\binet_interfaces\b;<a href="postconf.5.html#inet_interfaces">$&</a>;g;
     s;\binitial_destination_concurrency\b;<a href="postconf.5.html#initial_destination_concurrency">$&</a>;g;
     s;\binvalid_hostname_reject_code\b;<a href="postconf.5.html#invalid_hostname_reject_code">$&</a>;g;
-    s;\binvalid_header_rewrite_con[-</bB>]*\n* *[<bB>]*text_domain\b;<a href="postconf.5.html#invalid_header_rewrite_context_domain">$&</a>;g;
     s;\bipc_idle\b;<a href="postconf.5.html#ipc_idle">$&</a>;g;
     s;\bipc_timeout\b;<a href="postconf.5.html#ipc_timeout">$&</a>;g;
     s;\bipc_ttl\b;<a href="postconf.5.html#ipc_ttl">$&</a>;g;
@@ -211,7 +210,7 @@ while (<>) {
     s;\blocal_recip[-</bB>]*\n* *[<bB>]*ient_maps\b;<a href="postconf.5.html#local_recipient_maps">$&</a>;g;
     s;\blocal_transport\b;<a href="postconf.5.html#local_transport">$&</a>;g;
     s;\bluser_relay\b;<a href="postconf.5.html#luser_relay">$&</a>;g;
-    s;\blocal_header_rewrite_con[-</bB>]*\n* *[<bB>]*text_clients\b;<a href="postconf.5.html#local_header_rewrite_context_clients">$&</a>;g;
+    s;\blocal_header_rewrite_clients\b;<a href="postconf.5.html#local_header_rewrite_clients">$&</a>;g;
     s;\bmail_name\b;<a href="postconf.5.html#mail_name">$&</a>;g;
     s;\bmail_owner\b;<a href="postconf.5.html#mail_owner">$&</a>;g;
     s;\bmail_release_date\b;<a href="postconf.5.html#mail_release_date">$&</a>;g;
@@ -276,7 +275,7 @@ while (<>) {
     s;\brbl_reply_maps\b;<a href="postconf.5.html#rbl_reply_maps">$&</a>;g;
     s;\breadme_directory\b;<a href="postconf.5.html#readme_directory">$&</a>;g;
     s;\breceive_override_options\b;<a href="postconf.5.html#receive_override_options">$&</a>;g;
-    s;\bremote_header_rewrite_con[-</bB>]*\n* *[<bB>]*text_name\b;<a href="postconf.5.html#remote_header_rewrite_context_name">$&</a>;g;
+    s;\bremote_header_rewrite_domain\b;<a href="postconf.5.html#remote_header_rewrite_domain">$&</a>;g;
     s;\bno_unknown_recip[-</bB>]*\n* *[<bB>]*ient_checks\b;<a href="postconf.5.html#no_unknown_recipient_checks">$&</a>;g;
     s;\bno_address_mappings\b;<a href="postconf.5.html#no_address_mappings">$&</a>;g;
     s;\bno_header_body_checks\b;<a href="postconf.5.html#no_header_body_checks">$&</a>;g;
@@ -527,6 +526,7 @@ while (<>) {
 
     # Access restrictions - generic
 
+    s;\bcheck_address_map\b;<a href="postconf.5.html#check_address_map">$&</a>;g;
     s;\bcheck_policy_service\b;<a href="postconf.5.html#check_policy_service">$&</a>;g;
     s;\bdefer_if_permit\b;<a href="postconf.5.html#defer_if_permit">$&</a>;g;
     s;\bdefer_if_reject\b;<a href="postconf.5.html#defer_if_reject">$&</a>;g;
@@ -538,6 +538,9 @@ while (<>) {
 
     s;\bcheck_client_access\b;<a href="postconf.5.html#check_client_access">$&</a>;g;
     s;\bpermit_mynetworks\b;<a href="postconf.5.html#permit_mynetworks">$&</a>;g;
+    s;\bpermit_sasl_authenticated\b;<a href="postconf.5.html#permit_sasl_authenticated">$&</a>;g;
+    s;\bpermit_tls_clientcerts\b;<a href="postconf.5.html#permit_tls_clientcerts">$&</a>;g;
+    s;\bpermit_tls_all_clientcerts\b;<a href="postconf.5.html#permit_tls_all_clientcerts">$&</a>;g;
     s;\breject_unknown_client\b;<a href="postconf.5.html#reject_unknown_client">$&</a>;g;
     s;\breject_rbl_client\b;<a href="postconf.5.html#reject_rbl_client">$&</a>;g;
     s;\breject_rhsbl_client\b;<a href="postconf.5.html#reject_rhsbl_client">$&</a>;g;
index bc3a9e116dbb996b1eee392fedbf578111400313..99021200b65d365139f53dcf0c7d1bb72affd74b 100644 (file)
@@ -4120,7 +4120,13 @@ least significant octets. See the access(5) manual page for details. </dd>
 <dt><b><a name="permit_mynetworks">permit_mynetworks</a></b></dt>
 
 <dd>Permit the request when the client IP address matches any
-network listed in  $mynetworks. </dd>
+network or network address listed in  $mynetworks. </dd>
+
+<dt><b><a name="permit_sasl_authenticated">permit_sasl_authenticated</a></b></dt>
+
+<dd> Permit the request when the client is successfully
+authenticated via the RFC 2554 (AUTH) protocol. </dd>
+
 
 <dt><b><a name="reject_rbl_client">reject_rbl_client <i>rbl_domain=d.d.d.d</i></a></b></dt>
 
@@ -5551,7 +5557,7 @@ and postdrop(1).
 <p>
 With locally submitted mail, append the string "@$myorigin" to mail
 addresses without domain information. With remotely submitted mail,
-append the string "@$invalid_domain" instead.
+append the string "@$remote_header_rewrite_domain" instead.
 </p>
 
 <p>
@@ -5564,7 +5570,8 @@ Postfix does not support domain-less addresses.
 <p>
 With locally submitted mail, append the string ".$mydomain" to
 addresses that have no ".domain" information. With remotely submitted
-mail, append the string ".$invalid_domain" instead.
+mail, append the string ".$remote_header_rewrite_domain"
+instead.
 </p>
 
 <p>
@@ -7211,69 +7218,66 @@ is already bounded by $max_idle.  </p>
 session cache hit and miss rates for logical destinations and for
 physical endpoints. </p>
 
-%PARAM invalid_header_rewrite_context_domain domain.invalid
+%PARAM remote_header_rewrite_domain domain.invalid
 
-<p> Append this domain to incomplete message header addresses from
-remote clients, when $remote_header_rewrite_context_name is set to
-"invalid".  This is one way to avoid appending your own domain to
-addresses in spam from poorly written software. </p>
+<p> Append this domain name to incomplete message header addresses
+from remote clients; when this domain name is empty, don't rewrite
+remote message headers at all.  Both stop Postfix from appending
+your own domain to addresses in spam from poorly written software.
+</p>
 
-%PARAM local_header_rewrite_context_clients $mynetworks
+%PARAM local_header_rewrite_clients see "postconf -d" output
 
-<p> Append the domain names in $myorigin and $mydomain to incomplete
-message header addresses from these clients.  </p>
+<p> Append the domain name in $myorigin or $mydomain to incomplete
+message header addresses from these clients; append
+$remote_header_rewrite_domain for all other clients.  </p>
 
-<p> Specify a list of network addresses or network/netmask patterns,
-separated by comma or whitespace. Continue long lines by starting
-the next line with whitespace. </p>
+<p> Specify a list of zero or more of the following:  </p>
 
-<p> A network mask specifies the number of bits in the network part
-of a host address.  You can also specify "/file/name" or "type:table"
-patterns.  A "/file/name" pattern is replaced by its contents; a
-"type:table" lookup table is matched when a client name or address
-matches a lookup key (the lookup result is ignored). </p>
+<dl>
 
-<p> The list is matched left to right, and the search stops on the
-first match.  Specify "!pattern" to exclude an address or network
-block from the list.  </p>
+<dt> <b> permit_mynetworks </b></dt>
 
+<dd> Append the domain name in $myorigin or $mydomain when the
+client IP address matches any network or network address listed in
+$mynetworks. This is enabled by default. </dd>
 
-<p>
-Examples:
-</p>
+<dt><b> permit_sasl_authenticated </b></dt>
 
-<pre>
-local_header_rewrite_context_clients = $mynetworks
-local_header_rewrite_context_clients = !192.168.0.1 $mynetworks
-local_header_rewrite_context_clients = static:all
-</pre>
+<dd> Append the domain name in $myorigin or $mydomain when the
+client is successfully authenticated via the RFC 2554 (AUTH)
+protocol. This is enabled by default. </dd>
 
-%PARAM remote_header_rewrite_context_name local
+<dt><b> permit_tls_clientcerts </b></dt>
 
-<p> The address rewriting context that should be used for incomplete
-mail header addresses from remote clients. </p>
+<dd> Append the domain name in $myorigin or $mydomain when the
+client TLS certificate is successfully verified, and the client
+certificate fingerprint is listed on the server. This is enabled
+by default. </dd>
 
-<ul>
+<dt><b> permit_tls_all_clientcerts </b></dt>
 
-<li> <p> <b>local</b> Append the domains specified with $myorigin
-or $mydomain to incomplete message header addresses from remote
-clients.  </p>
+<dd> Append the domain name in $myorigin or $mydomain when the
+client TLS certificate is successfully verified, regardless of
+whether it is listed on the server, and regardless of the certifying
+authority. </dd>
 
-<li> <p> <b>invalid</b> Append the domain specified with
-$invalid_header_rewrite_context_domain to incomplete message header
-addresses from remote clients. This is one way to avoid appending
-your own domain to addresses in spam from poorly written software.
-This is a safe choice for gateways that have no control over
-address rewriting by down-stream systems.
-</p>
+<dt><b> <a name="check_address_map">check_address_map</a> <i><a
+href="DATABASE_README.html">type:table</a></i> </b></dt>
 
-<li> <p> <b>none</b> Don't modify message headers from remote
-clients at all. This is another way to avoid appending your own
-domain to addresses in spam from poorly written software. This
-is the preferred choice for purists. </p>
+<dt><b> <i><a href="DATABASE_README.html">type:table</a></i>
+</b></dt>
 
-</ul>
+<dd> Append the domain name in $myorigin or $mydomain when the
+client IP address matches the specified lookup table. The lookup
+result is ignored, and no subnet lookup is done. This is suitable
+for pop-before-smtp lookup tables. </dd>
 
-<p> Note: Postfix always appends the domains specified with $myorigin
-or $mydomain to incomplete envelope addresses, because those
-addresses are effectively equivalent to local addresses. </p>
+</dl>
+
+<p> Examples:  </p>
+
+<pre> 
+local_header_rewrite_clients = static:all
+local_header_rewrite_clients = permit_mynetworks, permit_sasl_authenticated 
+</pre>
index ba2aea0863ab8856ecf2569da2b0a70a5783962a..f540446dbfe64da5ab783806cce9211ffc1551af 100644 (file)
@@ -130,6 +130,7 @@ cleanup_addr.o: ../../include/mail_addr_find.h
 cleanup_addr.o: ../../include/maps.h
 cleanup_addr.o: ../../include/dict.h
 cleanup_addr.o: ../../include/argv.h
+cleanup_addr.o: ../../include/rewrite_clnt.h
 cleanup_addr.o: cleanup.h
 cleanup_addr.o: ../../include/nvtable.h
 cleanup_addr.o: ../../include/htable.h
@@ -196,6 +197,7 @@ cleanup_envelope.o: ../../include/verp_sender.h
 cleanup_envelope.o: ../../include/mail_proto.h
 cleanup_envelope.o: ../../include/iostuff.h
 cleanup_envelope.o: ../../include/attr.h
+cleanup_envelope.o: ../../include/rewrite_clnt.h
 cleanup_envelope.o: cleanup.h
 cleanup_envelope.o: ../../include/argv.h
 cleanup_envelope.o: ../../include/maps.h
@@ -382,6 +384,7 @@ cleanup_message.o: ../../include/iostuff.h
 cleanup_message.o: ../../include/attr.h
 cleanup_message.o: ../../include/mime_state.h
 cleanup_message.o: ../../include/lex_822.h
+cleanup_message.o: ../../include/rewrite_clnt.h
 cleanup_message.o: cleanup.h
 cleanup_message.o: ../../include/maps.h
 cleanup_message.o: ../../include/dict.h
@@ -451,10 +454,9 @@ cleanup_rewrite.o: ../../include/vstring.h
 cleanup_rewrite.o: ../../include/vbuf.h
 cleanup_rewrite.o: ../../include/tok822.h
 cleanup_rewrite.o: ../../include/resolve_clnt.h
+cleanup_rewrite.o: ../../include/rewrite_clnt.h
 cleanup_rewrite.o: ../../include/quote_822_local.h
 cleanup_rewrite.o: ../../include/quote_flags.h
-cleanup_rewrite.o: ../../include/rewrite_clnt.h
-cleanup_rewrite.o: ../../include/mail_params.h
 cleanup_rewrite.o: cleanup.h
 cleanup_rewrite.o: ../../include/vstream.h
 cleanup_rewrite.o: ../../include/argv.h
@@ -481,6 +483,7 @@ cleanup_state.o: ../../include/been_here.h
 cleanup_state.o: ../../include/mail_params.h
 cleanup_state.o: ../../include/mime_state.h
 cleanup_state.o: ../../include/header_opts.h
+cleanup_state.o: ../../include/rewrite_clnt.h
 cleanup_state.o: cleanup.h
 cleanup_state.o: ../../include/vstream.h
 cleanup_state.o: ../../include/argv.h
index dab7dbf4b0431d223ef87fef14fcbf1494019b99..ecc57781287b1c9865c3c3eb2a64d12e808cfd08 100644 (file)
@@ -76,6 +76,7 @@
 #include <mail_addr.h>
 #include <canon_addr.h>
 #include <mail_addr_find.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
@@ -83,7 +84,6 @@
 
 #define STR                    vstring_str
 #define IGNORE_EXTENSION       (char **) 0
-#define STREQ(x,y)             (strcmp((x), (y)) == 0)
 
 /* cleanup_addr_sender - process envelope sender record */
 
@@ -92,6 +92,14 @@ void    cleanup_addr_sender(CLEANUP_STATE *state, const char *buf)
     VSTRING *clean_addr = vstring_alloc(100);
     const char *bcc;
 
+    /*
+     * Note: an unqualified username is for all practical purposes equivalent
+     * to a fully qualified local address, if only because a reply to an
+     * incomplete address will be sent to a local recipient. Having to
+     * support both forms is error prone, therefore an incomplete envelope
+     * address is rewritten to fully qualified form in the local domain
+     * context.
+     */
     cleanup_rewrite_internal(REWRITE_LOCAL, clean_addr, buf);
     if (strncasecmp(STR(clean_addr), MAIL_ADDR_MAIL_DAEMON "@",
                    sizeof(MAIL_ADDR_MAIL_DAEMON)) == 0) {
@@ -131,6 +139,14 @@ void    cleanup_addr_recipient(CLEANUP_STATE *state, const char *buf)
     VSTRING *clean_addr = vstring_alloc(100);
     const char *bcc;
 
+    /*
+     * Note: an unqualified username is for all practical purposes equivalent
+     * to a fully qualified local address, if only because a reply to an
+     * incomplete address will be sent to a local recipient. Having to
+     * support both forms is error prone, therefore an incomplete envelope
+     * address is rewritten to fully qualified form in the local domain
+     * context.
+     */
     cleanup_rewrite_internal(REWRITE_LOCAL,
                             clean_addr, *buf ? buf : var_empty_addr);
     if (state->flags & CLEANUP_FLAG_MAP_OK) {
@@ -164,6 +180,10 @@ void    cleanup_addr_bcc(CLEANUP_STATE *state, const char *bcc)
 {
     VSTRING *clean_addr = vstring_alloc(100);
 
+    /*
+     * Note: BCC addresses are supplied locally, andmust be rewritten in the
+     * local address rewriting context.
+     */
     cleanup_rewrite_internal(REWRITE_LOCAL, clean_addr, bcc);
     if (state->flags & CLEANUP_FLAG_MAP_OK) {
        if (cleanup_rcpt_canon_maps
index 56d36c8eb0a658d28a45f49a7e71145ae9ad5b55..a86236c960fcf4a4fec6dc3612616dcd79cb3748 100644 (file)
@@ -68,6 +68,7 @@
 #include <mail_params.h>
 #include <verp_sender.h>
 #include <mail_proto.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
@@ -113,7 +114,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
     int     extra_opts;
     NAME_CODE rewrite_context_names[] = {
        REWRITE_LOCAL, 1,
-       REWRITE_INVALID, 1,
+       REWRITE_REMOTE, 1,
        REWRITE_NONE, 1,
        0, 0,
     };
index ddbc793a992c4241b73b71be4fb62ac716943a40..71dd5472af84da45d1aede0b592dc5a1ec1814f0 100644 (file)
@@ -80,6 +80,7 @@
 #include <mail_proto.h>
 #include <mime_state.h>
 #include <lex_822.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
index 6bc57f0e19b820084982097368072a9baf8f624d..9241ac8d84768038eafc21e22bca68717baa05a2 100644 (file)
@@ -69,8 +69,8 @@
 /* Global library. */
 
 #include <tok822.h>
-#include <quote_822_local.h>
 #include <rewrite_clnt.h>
+#include <quote_822_local.h>
 
 /* Application-specific. */
 
index 161bccbe9d1d47cf729b24f487dcecc6b4db9eac..3ffa5945b76d26c59742b6d0cd5c4d267b4ab706 100644 (file)
@@ -44,6 +44,7 @@
 #include <been_here.h>
 #include <mail_params.h>
 #include <mime_state.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
index a281c7f2d085fec919e50fd632654154f0610d7d..1dd4f6c0a0828d1f1b51586833f3a22efc4ff2f0 100644 (file)
@@ -455,7 +455,6 @@ canon_addr.o: ../../include/vstring.h
 canon_addr.o: ../../include/vbuf.h
 canon_addr.o: ../../include/mymalloc.h
 canon_addr.o: rewrite_clnt.h
-canon_addr.o: mail_params.h
 canon_addr.o: canon_addr.h
 cfg_parser.o: cfg_parser.c
 cfg_parser.o: ../../include/sys_defs.h
@@ -1382,7 +1381,6 @@ tok822_rewrite.o: ../../include/vstring.h
 tok822_rewrite.o: ../../include/vbuf.h
 tok822_rewrite.o: ../../include/msg.h
 tok822_rewrite.o: rewrite_clnt.h
-tok822_rewrite.o: mail_params.h
 tok822_rewrite.o: tok822.h
 tok822_rewrite.o: resolve_clnt.h
 tok822_tree.o: tok822_tree.c
index 39c835848aa2433e9e9e353f1d8a1018c1709252..b30fd0beeb33348573d9a8cc20c817f2802ef27a 100644 (file)
@@ -345,6 +345,7 @@ static DELIVER_REQUEST *deliver_request_alloc(void)
     request->sasl_method = 0;
     request->sasl_username = 0;
     request->sasl_sender = 0;
+    request->rewrite_context = 0;
     return (request);
 }
 
@@ -385,6 +386,8 @@ static void deliver_request_free(DELIVER_REQUEST *request)
        myfree(request->sasl_username);
     if (request->sasl_sender)
        myfree(request->sasl_sender);
+    if (request->rewrite_context)
+       myfree(request->rewrite_context);
     myfree((char *) request);
 }
 
index cfc481674f61497291fd0da646391d67fc987238..ce0a8bca688c07d7147bd088c4671aac587261ca 100644 (file)
@@ -2091,20 +2091,19 @@ extern char *var_anvil_service;
  /*
   * What domain names to assume when no valid domain context exists.
   */
-#define VAR_INV_RWR_DOMAIN             "invalid_header_rewrite_context_domain"
-#define DEF_INV_RWR_DOMAIN             "domain.invalid"
-extern char *var_inv_rwr_domain;
+#define VAR_REM_RWR_DOMAIN             "remote_header_rewrite_domain"
+#define DEF_REM_RWR_DOMAIN             "domain.invalid"
+extern char *var_remote_rwr_domain;
 
-#define VAR_REM_RWR_NAME               "remote_header_rewrite_context_name"
-#define DEF_REM_RWR_NAME               REWRITE_LOCAL
-extern char *var_remote_rwr_name;
+#define CHECK_ADDR_MAP                 "check_address_map"
 
-#define REWRITE_LOCAL  "local"
-#define REWRITE_INVALID        "invalid"
-#define REWRITE_NONE   "none"
-
-#define VAR_LOC_RWR_CLIENTS            "local_header_rewrite_context_clients"
-#define DEF_LOC_RWR_CLIENTS            "$" VAR_MYNETWORKS
+#define VAR_LOC_RWR_CLIENTS            "local_header_rewrite_clients"
+#ifdef USE_TLS
+#define DEF_LOC_RWR_CLIENTS            PERMIT_MYNETWORKS " " PERMIT_SASL_AUTH \
+                                       " " PERMIT_TLS_CLIENT
+#else
+#define DEF_LOC_RWR_CLIENTS            PERMIT_MYNETWORKS " " PERMIT_SASL_AUTH
+#endif
 extern char *var_local_rwr_clients;
 
 /* LICENSE
index ac7e0201906529c23a2b7c4884dabf1f7e27006f..82b858b605d977faf2586cd13fef78bdd42b7e26 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only.
   */
-#define MAIL_RELEASE_DATE      "20041020"
+#define MAIL_RELEASE_DATE      "20041021"
 #define MAIL_VERSION_NUMBER    "2.2"
 
 #define VAR_MAIL_VERSION       "mail_version"
index 0910b812e5b44f3b350b3b890ec7d8f826fe2114..5611f9fd10e8689f037d200a9483912acb81663c 100644 (file)
@@ -15,7 +15,6 @@
   * Utility library.
   */
 #include <vstring.h>
-#include <mail_params.h>
 
  /*
   * External interface.
 #define REWRITE_ADDR   "rewrite"
 #define REWRITE_CANON  REWRITE_LOCAL   /* backwards compatibility */
 
+ /*
+  * XXX These should be moved to mail_proto.h because they appear as
+  * attribute values in queue file records and delivery requests.
+  */
+#define REWRITE_LOCAL  "local"
+#define REWRITE_REMOTE "remote"
+#define REWRITE_NONE   "none"
+
 extern VSTRING *rewrite_clnt(const char *, const char *, VSTRING *);
 extern VSTRING *rewrite_clnt_internal(const char *, const char *, VSTRING *);
 
index 87a679610fb5e0d85a07ad8c48dc2c5324046821..addf6632176e6f94f44e31268fc049832d4bc02f 100644 (file)
@@ -11,16 +11,16 @@ local a@
 local a@.
 local a@b
 local a@b.
-invalid !
-invalid a!
-invalid !b
-invalid a!b
-invalid %
-invalid a%
-invalid %b
-invalid a%b
-invalid @
-invalid a@
-invalid a@.
-invalid a@b
-invalid a@b.
+remote !
+remote a!
+remote !b
+remote a!b
+remote %
+remote a%
+remote %b
+remote a%b
+remote @
+remote a@
+remote a@.
+remote a@b
+remote a@b.
index d846a4dd7664d6768d7350fdca3de7aec03a0194..1af7364835c0c9fde387fa7f1c18bebdd6b0c016 100644 (file)
@@ -50,55 +50,55 @@ rule       local
 address    a@b.
 result     a@b
 
-rule       invalid
+rule       remote
 address    !
 result     ""@
 
-rule       invalid
+rule       remote
 address    a!
 result     ""@a.domain.invalid
 
-rule       invalid
+rule       remote
 address    !b
 result     b@
 
-rule       invalid
+rule       remote
 address    a!b
 result     b@a.domain.invalid
 
-rule       invalid
+rule       remote
 address    %
 result     ""@
 
-rule       invalid
+rule       remote
 address    a%
 result     a@
 
-rule       invalid
+rule       remote
 address    %b
 result     ""@b.domain.invalid
 
-rule       invalid
+rule       remote
 address    a%b
 result     a@b.domain.invalid
 
-rule       invalid
+rule       remote
 address    @
 result     ""
 
-rule       invalid
+rule       remote
 address    a@
 result     a@
 
-rule       invalid
+rule       remote
 address    a@.
 result     a@.
 
-rule       invalid
+rule       remote
 address    a@b
 result     a@b.domain.invalid
 
-rule       invalid
+rule       remote
 address    a@b.
 result     a@b
 
index b45543ed8566672f7ae4f26e6080e84886c3dcb4..8c842691716a3c46b99c91612ecb32b39404db81 100644 (file)
 #include <mark_corrupt.h>
 #include <quote_821_local.h>
 #include <mail_proto.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
index 6987e83d34b48493dcfe2cd1880ba46c86526f6a..60b4c78dc6d08e90c732b01f87d57b13a068ceb9 100644 (file)
@@ -438,8 +438,8 @@ resolve.o: ../../include/iostuff.h
 resolve.o: ../../include/attr.h
 resolve.o: ../../include/resolve_clnt.h
 resolve.o: ../../include/rewrite_clnt.h
-resolve.o: ../../include/mail_params.h
 resolve.o: ../../include/tok822.h
+resolve.o: ../../include/mail_params.h
 resolve.o: ../../include/defer.h
 resolve.o: ../../include/bounce.h
 resolve.o: ../../include/deliver_request.h
index b015d9ee624a1134a58588e825f72c18b50421bf..e1be5a490dfa9e9f65ff35555350305708e269fa 100644 (file)
@@ -1119,6 +1119,8 @@ void    qmgr_message_free(QMGR_MESSAGE *message)
        myfree(message->sasl_username);
     if (message->sasl_sender)
        myfree(message->sasl_sender);
+    if (message->rewrite_context)
+       myfree(message->rewrite_context);
     qmgr_rcpt_list_free(&message->rcpt_list);
     qmgr_message_count--;
     myfree((char *) message);
index 52ddfcdb097651dbee4597e0a9103a757dec27fd..48052de60b34a17bdcb6093cd3f55e4fdfb8bfeb 100644 (file)
@@ -1225,6 +1225,8 @@ void    qmgr_message_free(QMGR_MESSAGE *message)
        myfree(message->sasl_username);
     if (message->sasl_sender)
        myfree(message->sasl_sender);
+    if (message->rewrite_context)
+       myfree(message->rewrite_context);
     qmgr_rcpt_list_free(&message->rcpt_list);
     qmgr_message_count--;
     myfree((char *) message);
index 4e13a1432eb5cfe2a9a1420f2257a7daa84d6568..e4ddb557d342b6286a8fc8f1cfd1e7d1a072b9b8 100644 (file)
 #include <quote_821_local.h>
 #include <mail_proto.h>
 #include <mime_state.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
index 0f6d945354fec44f410160bce511a9c2bc553c12..85c9a9efe2ac6421913caaf0393fba8cfbc89592 100644 (file)
 /*     filtering, or address mapping.
 /* .PP
 /*     Available in Postfix version 2.2 and later:
-/* .IP "\fBlocal_header_rewrite_context_clients ($mynetworks)\fR"
-/*     Append the domain names in $myorigin and $mydomain to incomplete
-/*     message header addresses from these clients.
-/* .IP "\fBremote_header_rewrite_context_name (local)\fR"
-/*     The address rewriting context that should be used for incomplete
-/*     mail header addresses from remote clients.
-/* .PP
-/*     Implemented by the trivial-rewrite(8) server:
-/* .IP "\fBinvalid_header_rewrite_context_domain (domain.invalid)\fR"
-/*     Append this domain to incomplete message header addresses from
-/*     remote clients, when $remote_header_rewrite_context_name is set to
-/*     "invalid".
+/* .IP "\fBlocal_header_rewrite_clients (see 'postconf -d' output)\fR"
+/*     Append the domain name in $myorigin or $mydomain to incomplete
+/*     message header addresses from these clients; append
+/*     $remote_header_rewrite_domain for all other clients.
+/* .IP "\fBremote_header_rewrite_domain (domain.invalid)\fR"
+/*     Append this domain name to incomplete message header addresses
+/*     from remote clients; when this domain name is empty, don't rewrite
+/*     remote message headers at all.
 /* AFTER QUEUE EXTERNAL CONTENT INSPECTION CONTROLS
 /* .ad
 /* .fi
 #include <anvil_clnt.h>
 #endif
 #include <flush_clnt.h>
+#include <rewrite_clnt.h>
 
 /* Single-threaded server skeleton. */
 
@@ -795,7 +792,7 @@ char   *var_smtpd_hoggers;
 
 #endif
 
-char   *var_remote_rwr_name;
+char   *var_remote_rwr_domain;
 char   *var_local_rwr_clients;
 
  /*
@@ -817,11 +814,13 @@ static NAMADR_LIST *verp_clients;
   * its own access control.
   */
 static NAMADR_LIST *xclient_hosts;
+static int xclient_allowed;            /* XXX should be SMTPD_STATE member */
 
  /*
   * XFORWARD command. Access control is cached.
   */
 static NAMADR_LIST *xforward_hosts;
+static int xforward_allowed;           /* XXX should be SMTPD_STATE member */
 
  /*
   * Client connection and rate limiting.
@@ -987,11 +986,11 @@ static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
     if (namadr_list_match(verp_clients, state->name, state->addr))
        smtpd_chat_reply(state, "250-%s", VERP_CMD);
     /* XCLIENT must not override its own access control. */
-    if (state->xclient_allowed)
+    if (xclient_allowed)
        smtpd_chat_reply(state, "250-" XCLIENT_CMD
                         " " XCLIENT_NAME " " XCLIENT_ADDR
                         " " XCLIENT_PROTO " " XCLIENT_HELO);
-    if (state->xforward_allowed)
+    if (xforward_allowed)
        smtpd_chat_reply(state, "250-" XFORWARD_CMD
                         " " XFORWARD_NAME " " XFORWARD_ADDR
                         " " XFORWARD_PROTO " " XFORWARD_HELO
@@ -1277,7 +1276,7 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
      */
 #ifdef SNAPSHOT
     if (SMTPD_STAND_ALONE(state) == 0
-       && !state->xclient_allowed
+       && !xclient_allowed
        && anvil_clnt
        && var_smtpd_cmail_limit > 0
        && !namadr_list_match(hogger_list, state->name, state->addr)
@@ -1487,7 +1486,7 @@ static int rcpt_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
      */
 #ifdef SNAPSHOT
     if (SMTPD_STAND_ALONE(state) == 0
-       && !state->xclient_allowed
+       && !xclient_allowed
        && anvil_clnt
        && var_smtpd_crcpt_limit > 0
        && !namadr_list_match(hogger_list, state->name, state->addr)
@@ -2105,7 +2104,7 @@ static int xclient_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
                         XCLIENT_CMD);
        return (-1);
     }
-    if (!state->xclient_allowed) {
+    if (!xclient_allowed) {
        state->error_mask |= MAIL_ERROR_POLICY;
        smtpd_chat_reply(state, "554 Error: insufficient authorization");
        return (-1);
@@ -2271,7 +2270,7 @@ static int xforward_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
                         XFORWARD_CMD);
        return (-1);
     }
-    if (!state->xforward_allowed) {
+    if (!xforward_allowed) {
        state->error_mask |= MAIL_ERROR_POLICY;
        smtpd_chat_reply(state, "554 Error: insufficient authorization");
        return (-1);
@@ -2374,7 +2373,8 @@ static int xforward_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
        case SMTPD_STATE_XFORWARD_DOMAIN:
            if (STREQ(attr_value, XFORWARD_UNAVAILABLE))
                attr_value = XFORWARD_DOM_LOCAL;
-           context_name[1] = var_remote_rwr_name;
+           context_name[1] = *var_remote_rwr_domain ? 
+               REWRITE_REMOTE : REWRITE_NONE;
            if ((context_code = name_code(xforward_to_context,
                                          NAME_CODE_FLAG_NONE,
                                          attr_value)) < 0) {
@@ -2550,7 +2550,7 @@ static void smtpd_proto(SMTPD_STATE *state, const char *service)
         */
 #ifdef SNAPSHOT
        if (SMTPD_STAND_ALONE(state) == 0
-           && !state->xclient_allowed
+           && !xclient_allowed
            && anvil_clnt
            && !namadr_list_match(hogger_list, state->name, state->addr)
            && anvil_clnt_connect(anvil_clnt, service, state->addr,
@@ -2651,7 +2651,7 @@ static void smtpd_proto(SMTPD_STATE *state, const char *service)
      */
 #ifdef SNAPSHOT
     if (SMTPD_STAND_ALONE(state) == 0
-       && !state->xclient_allowed
+       && !xclient_allowed
        && anvil_clnt
        && !namadr_list_match(hogger_list, state->name, state->addr))
        anvil_clnt_disconnect(anvil_clnt, service, state->addr);
@@ -2710,13 +2710,13 @@ static void smtpd_service(VSTREAM *stream, char *service, char **argv)
     /*
      * XCLIENT must not override its own access control.
      */
-    state.xclient_allowed =
+    xclient_allowed =
        namadr_list_match(xclient_hosts, state.name, state.addr);
 
     /*
      * Overriding XFORWARD access control makes no sense, either.
      */
-    state.xforward_allowed =
+    xforward_allowed =
        namadr_list_match(xforward_hosts, state.name, state.addr);
 
     /*
@@ -2793,12 +2793,6 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
 
 static void post_jail_init(char *unused_name, char **unused_argv)
 {
-    NAME_CODE rewrite_context_names[] = {
-       REWRITE_LOCAL, 1,
-       REWRITE_INVALID, 1,
-       REWRITE_NONE, 1,
-       0, 0,
-    };
 
     /*
      * Initialize the receive transparency options: do we want unknown
@@ -2827,14 +2821,6 @@ static void post_jail_init(char *unused_name, char **unused_argv)
        || var_smtpd_cmail_limit || var_smtpd_crcpt_limit)
        anvil_clnt = anvil_clnt_create();
 #endif
-
-    /*
-     * Sanity check.
-     */
-    if (name_code(rewrite_context_names, NAME_CODE_FLAG_STRICT_CASE,
-                 var_remote_rwr_name) == 0)
-       msg_fatal("parameter %s: invalid value: %s",
-                 VAR_REM_RWR_NAME, var_remote_rwr_name);
 }
 
 /* main - the main program */
@@ -2937,8 +2923,8 @@ int     main(int argc, char **argv)
 #ifdef SNAPSHOT
        VAR_SMTPD_HOGGERS, DEF_SMTPD_HOGGERS, &var_smtpd_hoggers, 0, 0,
 #endif
-       VAR_REM_RWR_NAME, DEF_REM_RWR_NAME, &var_remote_rwr_name, 1, 0,
-       VAR_LOC_RWR_CLIENTS, DEF_LOC_RWR_CLIENTS, &var_local_rwr_clients, 1, 0,
+       VAR_REM_RWR_DOMAIN, DEF_REM_RWR_DOMAIN, &var_remote_rwr_domain, 0, 0,
+       VAR_LOC_RWR_CLIENTS, DEF_LOC_RWR_CLIENTS, &var_local_rwr_clients, 0, 0,
        0,
     };
     static CONFIG_RAW_TABLE raw_table[] = {
index 54ae936d4c6b481e34dbb8f8d5cc4009066eb6e0..890be0b6fe8325bb06d20504a46118f87329a71d 100644 (file)
@@ -88,8 +88,6 @@ typedef struct SMTPD_STATE {
     int     junk_cmds;                 /* counter */
     int     rcpt_overshoot;            /* counter */
     char   *rewrite_context_name;      /* address rewriting context */
-    int     xclient_allowed;           /* permission to use XCLIENT */
-    int     xforward_allowed;          /* permission to use XFORWARD */
 
     /*
      * SASL specific.
index 593d42cfcec9e95e12db6a56d8b3f5fdfb5a14b5..077834d232c8e15ba1a10ab083f6268d4a8eff55 100644 (file)
@@ -48,7 +48,7 @@
 /*     smtpd_check_addr() sanity checks an email address and returns
 /*     non-zero in case of badness.
 /*
-/*     smtpd_check_rewrite() shuod be called before opening a queue
+/*     smtpd_check_rewrite() should be called before opening a queue
 /*     file or proxy connection, in order to establish the proper
 /*     header address rewriting context.
 /*
@@ -276,7 +276,6 @@ static MAPS *smtpd_sender_login_maps;
 static DOMAIN_LIST *relay_domains;
 static NAMADR_LIST *mynetworks;
 static NAMADR_LIST *perm_mx_networks;
-static NAMADR_LIST *local_rewrite_clients;
 
  /*
   * How to do parent domain wildcard matching, if any.
@@ -296,6 +295,8 @@ static ARGV *data_restrctions;
 static HTABLE *smtpd_rest_classes;
 static HTABLE *policy_clnt_table;
 
+static ARGV *local_rewrite_clients;
+
  /*
   * Pre-parsed expansion filter.
   */
@@ -322,6 +323,7 @@ static int check_rcpt_maps(SMTPD_STATE *, const char *, const char *);
 #define SMTPD_NAME_RECIPIENT   "Recipient address"
 #define SMTPD_NAME_ETRN                "Etrn command"
 #define SMTPD_NAME_DATA                "Data command"
+#define SMTPD_NAME_REWRITE     "Local address rewriting"
 
  /*
   * YASLM.
@@ -460,7 +462,7 @@ static void policy_client_register(const char *name)
 
 /* smtpd_check_parse - pre-parse restrictions */
 
-static ARGV *smtpd_check_parse(const char *checks)
+static ARGV *smtpd_check_parse(int flags, const char *checks)
 {
     char   *saved_checks = mystrdup(checks);
     ARGV   *argv = argv_alloc(1);
@@ -473,11 +475,17 @@ static ARGV *smtpd_check_parse(const char *checks)
      * encounter. Dictionaries must be opened before entering the chroot
      * jail.
      */
+#define SMTPD_CHECK_PARSE_POLICY       (1<<0)
+#define SMTPD_CHECK_PARSE_MAPS         (1<<1)
+#define SMTPD_CHECK_PARSE_ALL          (~0)
+
     while ((name = mystrtok(&bp, RESTRICTION_SEPARATORS)) != 0) {
        argv_add(argv, name, (char *) 0);
-       if (last && strcasecmp(last, CHECK_POLICY_SERVICE) == 0)
+       if ((flags & SMTPD_CHECK_PARSE_POLICY)
+           && last && strcasecmp(last, CHECK_POLICY_SERVICE) == 0)
            policy_client_register(name);
-       else if (strchr(name, ':') && dict_handle(name) == 0) {
+       else if ((flags & SMTPD_CHECK_PARSE_MAPS)
+                && strchr(name, ':') && dict_handle(name) == 0) {
            dict_register(name, dict_open(name, O_RDONLY, DICT_FLAG_LOCK));
        }
        last = name;
@@ -571,8 +579,6 @@ void    smtpd_check_init(void)
     perm_mx_networks =
        namadr_list_init(match_parent_style(VAR_PERM_MX_NETWORKS),
                         var_perm_mx_networks);
-    local_rewrite_clients =
-       namadr_list_init(MATCH_FLAG_NONE, var_local_rwr_clients);
 
     /*
      * Pre-parse and pre-open the recipient maps.
@@ -633,12 +639,18 @@ void    smtpd_check_init(void)
      * Pre-parse the restriction lists. At the same time, pre-open tables
      * before going to jail.
      */
-    client_restrctions = smtpd_check_parse(var_client_checks);
-    helo_restrctions = smtpd_check_parse(var_helo_checks);
-    mail_restrctions = smtpd_check_parse(var_mail_checks);
-    rcpt_restrctions = smtpd_check_parse(var_rcpt_checks);
-    etrn_restrctions = smtpd_check_parse(var_etrn_checks);
-    data_restrctions = smtpd_check_parse(var_data_checks);
+    client_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                          var_client_checks);
+    helo_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                        var_helo_checks);
+    mail_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                        var_mail_checks);
+    rcpt_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                        var_rcpt_checks);
+    etrn_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                        var_etrn_checks);
+    data_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                        var_data_checks);
 
     /*
      * Parse the pre-defined restriction classes.
@@ -650,7 +662,8 @@ void    smtpd_check_init(void)
            if ((value = mail_conf_lookup_eval(name)) == 0 || *value == 0)
                msg_fatal("restriction class `%s' needs a definition", name);
            htable_enter(smtpd_rest_classes, name,
-                        (char *) smtpd_check_parse(value));
+                        (char *) smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                                   value));
        }
        myfree(saved_classes);
     }
@@ -661,10 +674,12 @@ void    smtpd_check_init(void)
      */
 #if 0
     htable_enter(smtpd_rest_classes, "check_relay_domains",
-           smtpd_check_parse("permit_mydomain reject_unauth_destination"));
+                smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                             "permit_mydomain reject_unauth_destination"));
 #endif
     htable_enter(smtpd_rest_classes, REJECT_SENDER_LOGIN_MISMATCH,
-                (char *) smtpd_check_parse(REJECT_AUTH_SENDER_LOGIN_MISMATCH
+                (char *) smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                           REJECT_AUTH_SENDER_LOGIN_MISMATCH
                                  " " REJECT_UNAUTH_SENDER_LOGIN_MISMATCH));
 
     /*
@@ -681,6 +696,12 @@ void    smtpd_check_init(void)
      */
     expand_filter = vstring_alloc(10);
     unescape(expand_filter, var_smtpd_exp_filter);
+
+    /*
+     * Local rewrite policy.
+     */
+    local_rewrite_clients = smtpd_check_parse(SMTPD_CHECK_PARSE_MAPS,
+                                             var_local_rwr_clients);
 }
 
 /* log_whatsup - log as much context as we have */
@@ -3370,26 +3391,51 @@ int     smtpd_check_addr(const char *addr)
 
 void    smtpd_check_rewrite(SMTPD_STATE *state)
 {
+    const char *myname = "smtpd_check_rewrite";
+    int     status;
+    char  **cpp;
+    DICT   *dict;
 
     /*
-     * This should be made more configurable.
-     */
-#define SASL_AUTHENTICATED     1
-#define NOT_SASL_AUTHENTICATED 0
-
-    /*
-     * XXX We accept same syntax as mynetwork.
+     * We don't use generic_checks() because it produces results that
+     * aren't applicable such as DEFER or REJECT.
      */
-    if (SMTPD_STAND_ALONE(state)
-       || namadr_list_match(local_rewrite_clients, state->name, state->addr)
+    for (cpp = local_rewrite_clients->argv; *cpp != 0; cpp++) {
+       if (msg_verbose)
+           msg_info("%s: trying: %s", myname, *cpp);
+       status = SMTPD_CHECK_DUNNO;
+       if (strcasecmp(*cpp, PERMIT_MYNETWORKS) == 0) {
+           status = permit_mynetworks(state);
+       } else if (is_map_command(state, *cpp, CHECK_ADDR_MAP, &cpp)) {
+           if ((dict = dict_handle(*cpp)) == 0)
+               msg_panic("%s: dictionary not found: %s", myname, *cpp);
+           if (dict_get(dict, state->addr) != 0)
+               status = SMTPD_CHECK_OK;
+       } else if (strcasecmp(*cpp, PERMIT_SASL_AUTH) == 0) {
 #ifdef USE_SASL_AUTH
-       || permit_sasl_auth(state, SASL_AUTHENTICATED,
-                           NOT_SASL_AUTHENTICATED)
+           status = permit_sasl_auth(state, SMTPD_CHECK_OK,
+                                     SMTPD_CHECK_DUNNO);
+#else
+           status = SMTPD_CHECK_DUNNO;
 #endif
-       )
-       state->rewrite_context_name = mystrdup(REWRITE_LOCAL);
-    else
-       state->rewrite_context_name = mystrdup(var_remote_rwr_name);
+#ifdef USE_SSL
+       } else if (strcasecmp(*cpp, PERMIT_TLS_ALL_CLIENTCERTS) == 0) {
+           status = permit_tls_clientcerts(state, 1);
+       } else if (strcasecmp(*cpp, PERMIT_TLS_CLIENTCERTS) == 0) {
+           status = permit_tls_clientcerts(state, 0);
+#endif
+       } else {
+           msg_warn("parameter %s: invalid request: %s",
+                    VAR_LOC_RWR_CLIENTS, *cpp);
+           continue;
+       }
+       if (status == SMTPD_CHECK_OK) {
+           state->rewrite_context_name = mystrdup(REWRITE_LOCAL);
+           return;
+       }
+    }
+    state->rewrite_context_name = mystrdup(*var_remote_rwr_domain ?
+                                          REWRITE_REMOTE : REWRITE_NONE);
 }
 
 /* smtpd_check_client - validate client name or address */
@@ -4205,7 +4251,7 @@ static int rest_update(char **argv)
     for (rp = rest_table; rp->name; rp++) {
        if (strcasecmp(rp->name, argv[0]) == 0) {
            argv_free(rp->target[0]);
-           rp->target[0] = smtpd_check_parse(argv[1]);
+           rp->target[0] = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL, argv[1]);
            return (1);
        }
     }
@@ -4229,7 +4275,7 @@ static void rest_class(char *class)
        argv_free((ARGV *) entry->value);
     else
        entry = htable_enter(smtpd_rest_classes, name, (char *) 0);
-    entry->value = (char *) smtpd_check_parse(cp);
+    entry->value = (char *) smtpd_check_parse(SMTPD_CHECK_PARSE_ALL, cp);
 }
 
 /* resolve_clnt_init - initialize reply */
index 282743b92477f42ceea9489aa164a11233e8fb79..2030d27052eb415e921af07edabd400da9f032ab 100644 (file)
 #include <mail_params.h>
 #include <rec_type.h>
 #include <mail_proto.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
index f8d8e1e20510cfb4faf934cb081839c3bfe769fc..388957d55f0d12ddb603734834cf2bde259657cb 100644 (file)
@@ -115,8 +115,6 @@ void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream,
     state->instance = vstring_alloc(10);
     state->seqno = 0;
     state->rewrite_context_name = 0;
-    state->xclient_allowed = 0;
-    state->xforward_allowed = 0;
 
 #ifdef USE_SASL_AUTH
     if (SMTPD_STAND_ALONE(state))
index ecfa05cf75aae95d2abc508fc5263a338a901b32..84da86e67ec8b1282bd76738ff5a2cdd1d392384 100644 (file)
@@ -107,6 +107,7 @@ rewrite.o: ../../include/resolve_local.h
 rewrite.o: ../../include/tok822.h
 rewrite.o: ../../include/resolve_clnt.h
 rewrite.o: ../../include/mail_conf.h
+rewrite.o: ../../include/rewrite_clnt.h
 rewrite.o: trivial-rewrite.h
 transport.o: transport.c
 transport.o: ../../include/sys_defs.h
@@ -146,6 +147,7 @@ trivial-rewrite.o: ../../include/attr.h
 trivial-rewrite.o: ../../include/resolve_local.h
 trivial-rewrite.o: ../../include/mail_conf.h
 trivial-rewrite.o: ../../include/resolve_clnt.h
+trivial-rewrite.o: ../../include/rewrite_clnt.h
 trivial-rewrite.o: ../../include/tok822.h
 trivial-rewrite.o: ../../include/mail_addr.h
 trivial-rewrite.o: ../../include/mail_server.h
index a0eca67bfb7092e7b73488e39a80d0919a59f2e3..6bf8a4a5253ed73da76a745b906152e1618a4c1d 100644 (file)
@@ -21,7 +21,7 @@
 /*     TOK822  *tree;
 /*
 /*     RWR_CONTEXT local_context;
-/*     RWR_CONTEXT inval_context;
+/*     RWR_CONTEXT remote_context;
 /* DESCRIPTION
 /*     This module implements the trivial address rewriting engine.
 /*
@@ -39,7 +39,7 @@
 /*     rewrite_tree() rewrites a parse tree with a single address to
 /*     another tree.  A tree is a dummy node on top of a token list.
 /*
-/*     local_context and inval_context provide domain names for
+/*     local_context and remote_context provide domain names for
 /*     completing incomplete address forms.
 /* STANDARDS
 /* DIAGNOSTICS
@@ -78,6 +78,7 @@
 #include <resolve_local.h>
 #include <tok822.h>
 #include <mail_conf.h>
+#include <rewrite_clnt.h>
 
 /* Application-specific. */
 
@@ -88,9 +89,9 @@ RWR_CONTEXT local_context = {
     VAR_MYDOMAIN, &var_mydomain,
 };
 
-RWR_CONTEXT inval_context = {
-    VAR_INV_RWR_DOMAIN, &var_inv_rwr_domain,
-    VAR_INV_RWR_DOMAIN, &var_inv_rwr_domain,
+RWR_CONTEXT remote_context = {
+    VAR_REM_RWR_DOMAIN, &var_remote_rwr_domain,
+    VAR_REM_RWR_DOMAIN, &var_remote_rwr_domain,
 };
 
 static VSTRING *ruleset;
@@ -244,19 +245,10 @@ int     rewrite_proto(VSTREAM *stream)
                  ATTR_TYPE_END) != 2)
        return (-1);
 
-    /*
-     * Note: an unqualified username is for all practical purposes equivalent
-     * to a fully qualified local address, if only because a reply to an
-     * unqualified address will be sent to a local recipient. Having to
-     * support both forms is error prone, therefore an unqualified address is
-     * rewritten in the local domain context when no address rewriting
-     * context is given.
-     */
-    if (strcmp(vstring_str(ruleset), REWRITE_LOCAL) == 0
-       || strcmp(vstring_str(ruleset), REWRITE_NONE) == 0)
+    if (strcmp(vstring_str(ruleset), REWRITE_LOCAL) == 0)
        context = &local_context;
-    else if (strcmp(vstring_str(ruleset), REWRITE_INVALID) == 0)
-       context = &inval_context;
+    else if (strcmp(vstring_str(ruleset), REWRITE_REMOTE) == 0)
+       context = &remote_context;
     else {
        msg_warn("unknown context: %s", vstring_str(ruleset));
        return (-1);
index cdc1ebb7f943081711b8d8be98db6af2ccde1549..bf0b739884ef9b5018b67de890227f141559e7d3 100644 (file)
@@ -21,7 +21,7 @@
 /*     to \fIuser@domain\fR form.
 /* .IP \fBinvalid\fR
 /*     Append the domain name specified with
-/*     \fB$invalid_header_rewrite_context_domain\fR to incomplete
+/*     \fB$remote_header_rewrite_domain\fR to incomplete
 /*     addresses. Otherwise the result is identical to that of
 /*     the \fBlocal\fR address rewriting context. This prevents
 /*      Postfix from appending the local domain to spam from poorly
 /*     Enable the rewriting of "site!user" into "user@site".
 /* .PP
 /*     Available in Postfix 2.2 and later:
-/* .IP "\fBinvalid_header_rewrite_context_domain (domain.invalid)\fR"
+/* .IP "\fBremote_header_rewrite_domain (domain.invalid)\fR"
 /*     Append this domain to incomplete message header addresses from
-/*     remote clients, when $remote_header_rewrite_context_name is set to
-/*     "invalid".
-/* .PP
-/*     Implemented by the smtpd(8) server:
-/* .IP "\fBremote_header_rewrite_context_name (local)\fR"
-/*     The address rewriting context that should be used for incomplete
-/*     mail header addresses from remote clients.
+/*     remote clients; when the domain is empty, don't rewrite remote message
+/*     headers at all.
 /* ROUTING CONTROLS
 /* .ad
 /* .fi
@@ -301,7 +296,7 @@ char   *var_def_transport;
 char   *var_empty_addr;
 int     var_show_unk_rcpt_table;
 int     var_resolve_nulldom;
-char   *var_inv_rwr_domain;
+char   *var_remote_rwr_domain;
 
  /*
   * Shadow personality for address verification.
@@ -429,7 +424,7 @@ int     main(int argc, char **argv)
        VAR_VRFY_RELAY_XPORT, DEF_VRFY_RELAY_XPORT, &var_vrfy_relay_xport, 1, 0,
        VAR_VRFY_DEF_XPORT, DEF_VRFY_DEF_XPORT, &var_vrfy_def_xport, 1, 0,
        VAR_VRFY_RELAYHOST, DEF_VRFY_RELAYHOST, &var_vrfy_relayhost, 0, 0,
-       VAR_INV_RWR_DOMAIN, DEF_INV_RWR_DOMAIN, &var_inv_rwr_domain, 1, 0,
+       VAR_REM_RWR_DOMAIN, DEF_REM_RWR_DOMAIN, &var_remote_rwr_domain, 0, 0,
        0,
     };
     static CONFIG_BOOL_TABLE bool_table[] = {