]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.12-20260312
authorWietse Z Venema <wietse@porcupine.org>
Thu, 12 Mar 2026 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Sat, 14 Mar 2026 07:29:02 +0000 (18:29 +1100)
22 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/postalias.1.html
postfix/html/postmap.1.html
postfix/man/man1/postalias.1
postfix/man/man1/postmap.1
postfix/proto/stop.double-history
postfix/proto/stop.spell-cc
postfix/proto/stop.spell-history
postfix/src/global/Makefile.in
postfix/src/global/mail_addr_find.h
postfix/src/global/mail_version.c
postfix/src/global/mail_version.h
postfix/src/local/Makefile.in
postfix/src/local/alias.c
postfix/src/local/local.c
postfix/src/local/local.h
postfix/src/postalias/postalias.c
postfix/src/postmap/postmap.c
postfix/src/util/Makefile.in
postfix/src/util/dynamicmaps.c [moved from postfix/src/global/dynamicmaps.c with 99% similarity]
postfix/src/util/dynamicmaps.h [moved from postfix/src/global/dynamicmaps.h with 100% similarity]

index 546ef4f0010f9c8c37c04140865c75998648bf31..c578b1d40505167e99ed24cd5ffc9fd899e2505c 100644 (file)
@@ -30601,8 +30601,9 @@ Apologies for any names omitted.
        propagated. Report by Michael Tokarev, fix by Wietse. Files:
        global/mail_params.c, global/mail_params.h
 
-       Bugfix (defect introduced: 20260219): spurious error message
-       from nbdb_reindexd(8). File: conf/postfix-script.
+       Cleanup: during Postfix start-up, avoid a spurious error
+       message from nbdb_reindexd(8), when non_bdb_migration_level
+       disables automatic re-indexing. File: conf/postfix-script.
 
 20260310
 
@@ -30625,3 +30626,31 @@ Apologies for any names omitted.
        implementation-defined behavior (shift one bit into the
        sign position). This works today but may break later.
        Reported by Kamil Frankowicz. File: util/sys_defs.h.
+
+20260311
+
+       Preparation: move src/global/dynamicmaps.[hc] to src/util
+       without making any other code changes. This is a baseline
+       for developing support to build tests with "shared=yes
+       dynamicmaps=yes". Curently, tests must be built with
+       "shared=yes dynamicmaps=no", which is annoying.  Files:
+       util/dynamicmaps.[hc], util/Makefile.in, global/Makefile.in.
+
+20260312
+
+       Technical debt elimination: make postalias behavior consistent
+       with postmap behavior that was introduced with Postfix 3.2.
+       Store search keys in the external (quoted) form, and update
+       the local(8) delivery agent to search with the legacy
+       internal (unquoted) form only if the preferred external
+       form is not found, and the internal and external forms
+       differ. Files: postalias/postalias.c, local/alias.c,
+       local/local.[hc], local/Makefile.
+
+       Future proofing: added IfThisThenThat linter hints to remove
+       the legacy internal-form lookups consistently from database
+       client programs. Files: global/mail_addr_find.h, local/alias.c.
+
+       Deleted mail_version_parse() and mail_version_free()
+       infrastructure. It was used only by test code. Files:
+       src/global/mail_version.[hc].
index 392f191d2a93b3192aab9dfeeace324c6eaf6f5e..91e6190564ccc9c0090a0f2cbd5cb7faf068b8d9 100644 (file)
@@ -25,3 +25,20 @@ now also distributed with the more recent Eclipse Public License
 (EPL) 2.0. Recipients can choose to take the software under the
 license of their choice. Those who are more comfortable with the
 IPL can continue with that license.
+
+Incompatible changes with snapshot 20260312
+===========================================
+
+For consistency with postmap, the postalias command now stores the
+alias database search key in external (quoted) form. For example,
+if an alias name contains whitespace between the words 'foo' and
+'bar', then it will be stored as "foo bar" including the double
+quotes.
+
+For consistency with "postmap -s", the "postalias -s" command now
+outputs the search key in external (quoted) form.
+
+For backwards compatibility, the local(8) delivery agent will look
+up the legacy internal (unquoted) form of an alias name only if the
+preferred external (quoted) form is not found, and the internal and
+external forms differ.
index 9892c15060e8bb02de606e14c8b754044574169b..20799a08085f8f9b2b3c517bb199e47a5467a774 100644 (file)
@@ -37,82 +37,89 @@ POSTALIAS(1)                                                      POSTALIAS(1)
        <a href="regexp_table.5.html">regexp</a>: and <a href="pcre_table.5.html">pcre</a>:. This resulted in loss of  information  with  $<i>number</i>
        substitutions.
 
+       In  a  database file, <a href="postalias.1.html"><b>postalias</b>(1)</a> stores keys in the external (quoted)
+       form. Historically, Postfix versions 3.10 and earlier stored the inter-
+       nal  (unquoted) form. This was not consistent with <a href="postmap.1.html"><b>postmap</b>(1)</a> behavior.
+       For backwards compatibility, Postfix  programs  will  search  with  the
+       legacy  internal form only if the preferred external form is not found,
+       and the internal and external forms differ.
+
        Options:
 
        <b>-c</b> <i>config</i><b>_</b><i>dir</i>
-              Read  the  <a href="postconf.5.html"><b>main.cf</b></a>  configuration  file  in  the named directory
+              Read the <a href="postconf.5.html"><b>main.cf</b></a>  configuration  file  in  the  named  directory
               instead of the default configuration directory.
 
-       <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one entry per  map.
-              The  exit  status  is  zero  when  the requested information was
+       <b>-d</b> <i>key</i> Search  the specified maps for <i>key</i> and remove one entry per map.
+              The exit status is  zero  when  the  requested  information  was
               found.
 
-              If a key value of <b>-</b> is specified, the program reads  key  values
-              from  the standard input stream. The exit status is zero when at
+              If  a  key value of <b>-</b> is specified, the program reads key values
+              from the standard input stream. The exit status is zero when  at
               least one of the requested keys was found.
 
-       <b>-f</b>     Do not fold the lookup key  to  lower  case  while  creating  or
+       <b>-f</b>     Do  not  fold  the  lookup  key  to lower case while creating or
               querying a table.
 
-              With  Postfix  version  2.3 and later, this option has no effect
+              With Postfix version 2.3 and later, this option  has  no  effect
               for regular expression tables. There, case folding is controlled
               by appending a flag to a pattern.
 
-       <b>-i</b>     Incremental  mode.  Read  entries from standard input and do not
-              truncate an existing database. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a>  creates
+       <b>-i</b>     Incremental mode. Read entries from standard input  and  do  not
+              truncate  an existing database. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> creates
               a new database from the entries in <i>file</i><b>_</b><i>name</i>.
 
-       <b>-j</b>     JSON  output.  Format  the  output from <b>-q</b> and <b>-s</b> as one <b>{"</b><i>key</i><b>":</b>
+       <b>-j</b>     JSON output. Format the output from <b>-q</b> and  <b>-s</b>  as  one  <b>{"</b><i>key</i><b>":</b>
               <b>"</b><i>value</i><b>"}</b> object per line.
 
               This feature is available in Postfix version 3.11 and later.
 
-       <b>-N</b>     Include the terminating null character  that  terminates  lookup
-              keys  and  values. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> does whatever is the
+       <b>-N</b>     Include  the  terminating  null character that terminates lookup
+              keys and values. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> does whatever  is  the
               default for the host operating system.
 
-       <b>-n</b>     Don't include the terminating  null  character  that  terminates
-              lookup  keys  and values. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> does whatever
+       <b>-n</b>     Don't  include  the  terminating  null character that terminates
+              lookup keys and values. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a>  does  whatever
               is the default for the host operating system.
 
-       <b>-o</b>     Do not release root privileges when processing a non-root  input
+       <b>-o</b>     Do  not release root privileges when processing a non-root input
               file. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> drops root privileges and runs as
               the source file owner instead.
 
-       <b>-p</b>     Do not inherit the file access permissions from the  input  file
-              when  creating  a  new  file.   Instead,  create a new file with
+       <b>-p</b>     Do  not  inherit the file access permissions from the input file
+              when creating a new file.   Instead,  create  a  new  file  with
               default access permissions (mode 0644).
 
-       <b>-q</b> <i>key</i> Search the specified maps for <i>key</i>  and  write  the  first  value
-              found  to  the  standard  output stream. The exit status is zero
+       <b>-q</b> <i>key</i> Search  the  specified  maps  for  <i>key</i> and write the first value
+              found to the standard output stream. The  exit  status  is  zero
               when the requested information was found.
 
-              Note: this performs a single query with the  key  as  specified,
-              and  does  not make iterative queries with substrings of the key
+              Note:  this  performs  a single query with the key as specified,
+              and does not make iterative queries with substrings of  the  key
               as described in the <a href="aliases.5.html">aliases(5)</a> manual page.
 
-              If a key value of <b>-</b> is specified, the program reads  key  values
+              If  a  key value of <b>-</b> is specified, the program reads key values
               from the standard input stream and writes one line of <i>key: value</i>
               output for each key that was found. The exit status is zero when
               at least one of the requested keys was found.
 
-       <b>-r</b>     When  updating a table, do not complain about attempts to update
+       <b>-r</b>     When updating a table, do not complain about attempts to  update
               existing entries, and make those updates anyway.
 
        <b>-s</b>     Retrieve all database elements, and write one line of <i>key: value</i>
-              output  for  each  element. The elements are printed in database
-              order, which is not necessarily the same as the  original  input
-              order.   This  feature  is  available in Postfix version 2.2 and
+              output for each element. The elements are  printed  in  database
+              order,  which  is not necessarily the same as the original input
+              order.  This feature is available in  Postfix  version  2.2  and
               later, and is not available for all database types.
 
-       <b>-u</b>     Disable UTF-8 support. UTF-8 support is enabled by default  when
-              "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a>  =  yes".  It requires that keys and values are
+       <b>-u</b>     Disable  UTF-8 support. UTF-8 support is enabled by default when
+              "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> = yes". It requires that keys  and  values  are
               valid UTF-8 strings.
 
-       <b>-v</b>     Enable verbose  logging  for  debugging  purposes.  Multiple  <b>-v</b>
+       <b>-v</b>     Enable  verbose  logging  for  debugging  purposes.  Multiple <b>-v</b>
               options make the software increasingly verbose.
 
-       <b>-w</b>     When  updating a table, do not complain about attempts to update
+       <b>-w</b>     When updating a table, do not complain about attempts to  update
               existing entries, and ignore those attempts.
 
        Arguments:
@@ -121,35 +128,35 @@ POSTALIAS(1)                                                      POSTALIAS(1)
               The database type. To find out what types are supported, use the
               "<b>postconf -m</b>" command.
 
-              When  no  <i>file</i><b>_</b><i>type</i> is specified, the software uses the database
-              type  specified  via  the  <b><a href="postconf.5.html#default_database_type">default_database_type</a></b>   configuration
-              parameter.   The default value for this parameter depends on the
+              When no <i>file</i><b>_</b><i>type</i> is specified, the software uses  the  database
+              type   specified  via  the  <b><a href="postconf.5.html#default_database_type">default_database_type</a></b>  configuration
+              parameter.  The default value for this parameter depends on  the
               host environment.
 
-              The <a href="postalias.1.html"><b>postalias</b>(1)</a> command can query any supported file type,  but
+              The  <a href="postalias.1.html"><b>postalias</b>(1)</a> command can query any supported file type, but
               it can create only the following file types:
 
-              <b>btree</b>  The  output is a btree file, named <i>file</i><b>_</b><i>name</i><b>.db</b>.  This is
+              <b>btree</b>  The output is a btree file, named <i>file</i><b>_</b><i>name</i><b>.db</b>.  This  is
                      available on systems with support for <b>db</b> databases.
 
-              <b>cdb</b>    The output is one  file  named  <i>file</i><b>_</b><i>name</i><b>.cdb</b>.   This  is
+              <b>cdb</b>    The  output  is  one  file  named <i>file</i><b>_</b><i>name</i><b>.cdb</b>.  This is
                      available on systems with support for <b>cdb</b> databases.
 
               <b>dbm</b>    The output consists of two files, named <i>file</i><b>_</b><i>name</i><b>.pag</b> and
                      <i>file</i><b>_</b><i>name</i><b>.dir</b>.  This is available on systems with support
                      for <b>dbm</b> databases.
 
-              <b>fail</b>   A  table that reliably fails all requests. The lookup ta-
-                     ble name is used for logging only. This table  exists  to
+              <b>fail</b>   A table that reliably fails all requests. The lookup  ta-
+                     ble  name  is used for logging only. This table exists to
                      simplify Postfix error tests.
 
               <b>hash</b>   The output is a hashed file, named <i>file</i><b>_</b><i>name</i><b>.db</b>.  This is
                      available on systems with support for <b>db</b> databases.
 
-              <b>lmdb</b>   The output is a btree-based file,  named  <i>file</i><b>_</b><i>name</i><b>.lmdb</b>.
-                     <b>lmdb</b>  supports concurrent writes and reads from different
+              <b>lmdb</b>   The  output  is a btree-based file, named <i>file</i><b>_</b><i>name</i><b>.lmdb</b>.
+                     <b>lmdb</b> supports concurrent writes and reads from  different
                      processes,  unlike  other  supported  file-based  tables.
-                     This  is available on systems with support for <b>lmdb</b> data-
+                     This is available on systems with support for <b>lmdb</b>  data-
                      bases.
 
               <b>sdbm</b>   The output consists of two files, named <i>file</i><b>_</b><i>name</i><b>.pag</b> and
@@ -161,11 +168,11 @@ POSTALIAS(1)                                                      POSTALIAS(1)
               base.
 
 <b><a name="diagnostics">DIAGNOSTICS</a></b>
-       Problems  are  logged to the standard error stream and to <b>syslogd</b>(8) or
-       <a href="postlogd.8.html"><b>postlogd</b>(8)</a>. No output means that no problems were detected.  Duplicate
+       Problems are logged to the standard error stream and to  <b>syslogd</b>(8)  or
+       <a href="postlogd.8.html"><b>postlogd</b>(8)</a>.  No output means that no problems were detected. Duplicate
        entries are skipped and are flagged with a warning.
 
-       <a href="postalias.1.html"><b>postalias</b>(1)</a>  terminates  with  zero  exit  status  in  case of success
+       <a href="postalias.1.html"><b>postalias</b>(1)</a> terminates with  zero  exit  status  in  case  of  success
        (including  successful  "<b>postalias  -q</b>"  lookup)  and  terminates  with
        non-zero exit status in case of failure.
 
@@ -177,22 +184,22 @@ POSTALIAS(1)                                                      POSTALIAS(1)
               Enable verbose logging for debugging purposes.
 
 <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b>
-       The  following  <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to this pro-
+       The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to  this  pro-
        gram.
 
-       The text below provides only a parameter summary. See  <a href="postconf.5.html"><b>postconf</b>(5)</a>  for
+       The  text  below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for
        more details including examples.
 
        <b><a href="postconf.5.html#alias_database">alias_database</a> (see 'postconf -d' output)</b>
-              The  alias databases for <a href="local.8.html"><b>local</b>(8)</a> delivery that are updated with
+              The alias databases for <a href="local.8.html"><b>local</b>(8)</a> delivery that are updated  with
               "<b>newaliases</b>" or with "<b>sendmail -bi</b>".
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The default location of the Postfix <a href="postconf.5.html">main.cf</a> and  <a href="master.5.html">master.cf</a>  con-
+              The  default  location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con-
               figuration files.
 
        <b><a href="postconf.5.html#berkeley_db_create_buffer_size">berkeley_db_create_buffer_size</a> (16777216)</b>
-              The  per-table I/O buffer size for programs that create Berkeley
+              The per-table I/O buffer size for programs that create  Berkeley
               DB hash or btree tables.
 
        <b><a href="postconf.5.html#berkeley_db_read_buffer_size">berkeley_db_read_buffer_size</a> (131072)</b>
@@ -204,19 +211,19 @@ POSTALIAS(1)                                                      POSTALIAS(1)
               and <a href="postmap.1.html"><b>postmap</b>(1)</a> commands.
 
        <b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b>
-              The list of environment  variables  that  a  privileged  Postfix
-              process  will  import  from  a  non-Postfix  parent  process, or
+              The  list  of  environment  variables  that a privileged Postfix
+              process will  import  from  a  non-Postfix  parent  process,  or
               name=value environment overrides.
 
        <b><a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> (yes)</b>
-              Enable preliminary SMTPUTF8 support for the protocols  described
+              Enable  preliminary SMTPUTF8 support for the protocols described
               in <a href="https://tools.ietf.org/html/rfc6531">RFC 6531</a>, <a href="https://tools.ietf.org/html/rfc6532">RFC 6532</a>, and <a href="https://tools.ietf.org/html/rfc6533">RFC 6533</a>.
 
        <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> (see 'postconf -d' output)</b>
-              A  prefix  that  is  prepended  to  the  process  name in syslog
+              A prefix that  is  prepended  to  the  process  name  in  syslog
               records, so that, for example, "smtpd" becomes "prefix/smtpd".
 
        Available in Postfix 2.11 and later:
index 7640579f4993e138c988317d6fa8dba6b59883f4..9f1cd8d982b6a427e0467bff2ae7a07627ce7201 100644 (file)
@@ -42,95 +42,98 @@ POSTMAP(1)                                                          POSTMAP(1)
        space is stripped off. Whitespace in lookup keys is supported in  Post-
        fix  3.2 and later, by surrounding the key with double quote characters
        `"'. Within the double quotes, double quote `"' and backslash `\' char-
-       acters can be included by quoting them with a preceding backslash.
+       acters  can be included by quoting them with a preceding backslash. For
+       backwards compatibility, Postfix programs will search with  the  legacy
+       internal form only if the preferred external form is not found, and the
+       internal and external forms differ.
 
-       When  the  <b>-F</b> option is given, the <i>value</i> must specify one or more file-
+       When the <b>-F</b> option is given, the <i>value</i> must specify one or  more  file-
        names separated by comma and/or whitespace; <a href="postmap.1.html"><b>postmap</b>(1)</a> will concatenate
-       the  file content (with a newline character inserted between files) and
+       the file content (with a newline character inserted between files)  and
        will store the base64-encoded result instead of the <i>value</i>.
 
-       When the <i>key</i> specifies email address information, the localpart  should
+       When  the <i>key</i> specifies email address information, the localpart should
        be enclosed with double quotes if required by <a href="https://tools.ietf.org/html/rfc5322">RFC 5322</a>. For example, an
        address localpart that contains ";", or a localpart that starts or ends
        with ".".
 
-       By  default  the  lookup key is mapped to lowercase to make the lookups
+       By default the lookup key is mapped to lowercase to  make  the  lookups
        case insensitive; as of Postfix 2.3 this case folding happens only with
        tables whose lookup keys are fixed-case strings such as <a href="DATABASE_README.html#types">btree</a>:, <a href="DATABASE_README.html#types">dbm</a>: or
        <a href="DATABASE_README.html#types">hash</a>:. With earlier versions, the lookup key is folded even with tables
-       where  a lookup field can match both upper and lower case text, such as
-       <a href="regexp_table.5.html">regexp</a>: and <a href="pcre_table.5.html">pcre</a>:. This resulted in loss of  information  with  $<i>number</i>
+       where a lookup field can match both upper and lower case text, such  as
+       <a href="regexp_table.5.html">regexp</a>:  and  <a href="pcre_table.5.html">pcre</a>:.  This resulted in loss of information with $<i>number</i>
        substitutions.
 
 <b><a name="command-line_arguments">COMMAND-LINE ARGUMENTS</a></b>
-       <b>-b</b>     Enable  message  body  query mode. When reading lookup keys from
-              standard input with "<b>-q -</b>", process the input as  if  it  is  an
-              email  message  in  <a href="https://tools.ietf.org/html/rfc5322">RFC  5322</a> format.  Each line of body content
+       <b>-b</b>     Enable message body query mode. When reading  lookup  keys  from
+              standard  input  with  "<b>-q  -</b>", process the input as if it is an
+              email message in <a href="https://tools.ietf.org/html/rfc5322">RFC 5322</a> format.  Each  line  of  body  content
               becomes one lookup key.
 
-              By default, the <b>-b</b> option starts generating lookup keys  at  the
-              first  non-header line, and stops when the end of the message is
-              reached.  To simulate  <a href="header_checks.5.html"><b>body_checks</b>(5)</a>  processing,  enable  MIME
-              parsing   with  <b>-m</b>.  With  this,  the  <b>-b</b>  option  generates  no
-              body-style lookup keys  for  attachment  MIME  headers  and  for
+              By  default,  the <b>-b</b> option starts generating lookup keys at the
+              first non-header line, and stops when the end of the message  is
+              reached.   To  simulate  <a href="header_checks.5.html"><b>body_checks</b>(5)</a>  processing, enable MIME
+              parsing  with  <b>-m</b>.  With  this,  the  <b>-b</b>  option  generates   no
+              body-style  lookup  keys  for  attachment  MIME  headers and for
               attached message/* headers.
 
               NOTE: with "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> = yes", the <b>-b</b> option disables UTF-8
-              syntax checks on query keys and lookup results. Specify  the  <b>-U</b>
+              syntax  checks  on query keys and lookup results. Specify the <b>-U</b>
               option to force UTF-8 syntax checks anyway.
 
               This feature is available in Postfix version 2.6 and later.
 
        <b>-c</b> <i>config</i><b>_</b><i>dir</i>
-              Read  the  <a href="postconf.5.html"><b>main.cf</b></a>  configuration  file  in  the named directory
+              Read the <a href="postconf.5.html"><b>main.cf</b></a>  configuration  file  in  the  named  directory
               instead of the default configuration directory.
 
-       <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one entry per  map.
-              The  exit  status  is  zero  when  the requested information was
+       <b>-d</b> <i>key</i> Search  the specified maps for <i>key</i> and remove one entry per map.
+              The exit status is  zero  when  the  requested  information  was
               found.
 
-              If a key value of <b>-</b> is specified, the program reads  key  values
-              from  the standard input stream. The exit status is zero when at
+              If  a  key value of <b>-</b> is specified, the program reads key values
+              from the standard input stream. The exit status is zero when  at
               least one of the requested keys was found.
 
-       <b>-f</b>     Do not fold the lookup key  to  lower  case  while  creating  or
+       <b>-f</b>     Do  not  fold  the  lookup  key  to lower case while creating or
               querying a table.
 
-              With  Postfix  version  2.3 and later, this option has no effect
+              With Postfix version 2.3 and later, this option  has  no  effect
               for regular expression tables. There, case folding is controlled
               by appending a flag to a pattern.
 
        <b>-F</b>     When querying a map, or listing a map, base64-decode each value.
-              When creating a map from source file, process each  value  as  a
-              list  of  filenames, concatenate the content of those files, and
-              store the base64-encoded result instead of the value (see  INPUT
+              When  creating  a  map from source file, process each value as a
+              list of filenames, concatenate the content of those  files,  and
+              store  the base64-encoded result instead of the value (see INPUT
               FILE FORMAT for details).
 
               This feature is available in Postfix version 3.4 and later.
 
-       <b>-h</b>     Enable  message header query mode. When reading lookup keys from
-              standard input with "<b>-q -</b>", process the input as  if  it  is  an
-              email  message  in  <a href="https://tools.ietf.org/html/rfc5322">RFC  5322</a>  format.  Each logical header line
-              becomes one lookup key. A multi-line header becomes  one  lookup
+       <b>-h</b>     Enable message header query mode. When reading lookup keys  from
+              standard  input  with  "<b>-q  -</b>", process the input as if it is an
+              email message in <a href="https://tools.ietf.org/html/rfc5322">RFC 5322</a>  format.   Each  logical  header  line
+              becomes  one  lookup key. A multi-line header becomes one lookup
               key with one or more embedded newline characters.
 
-              By  default, the <b>-h</b> option generates lookup keys until the first
-              non-header line is reached.  To simulate  <a href="header_checks.5.html"><b>header_checks</b>(5)</a>  pro-
-              cessing,  enable  MIME parsing with <b>-m</b>. With this, the <b>-h</b> option
-              also generates header-style  lookup  keys  for  attachment  MIME
+              By default, the <b>-h</b> option generates lookup keys until the  first
+              non-header  line  is reached.  To simulate <a href="header_checks.5.html"><b>header_checks</b>(5)</a> pro-
+              cessing, enable MIME parsing with <b>-m</b>. With this, the  <b>-h</b>  option
+              also  generates  header-style  lookup  keys  for attachment MIME
               headers and for attached message/* headers.
 
-              NOTE:  with  "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a>  = yes", the <b>-h</b> option option dis-
-              ables UTF-8 syntax checks on  query  keys  and  lookup  results.
+              NOTE: with "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> = yes", the <b>-h</b>  option  option  dis-
+              ables  UTF-8  syntax  checks  on  query keys and lookup results.
               Specify the <b>-U</b> option to force UTF-8 syntax checks anyway.
 
               This feature is available in Postfix version 2.6 and later.
 
-       <b>-i</b>     Incremental  mode.  Read  entries from standard input and do not
-              truncate an existing database. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> creates  a
+       <b>-i</b>     Incremental mode. Read entries from standard input  and  do  not
+              truncate  an existing database. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> creates a
               new database from the entries in <b>file_name</b>.
 
-       <b>-j</b>     JSON  output.  Format  the  output from <b>-q</b> and <b>-s</b> as one <b>{"</b><i>key</i><b>":</b>
+       <b>-j</b>     JSON output. Format the output from <b>-q</b> and  <b>-s</b>  as  one  <b>{"</b><i>key</i><b>":</b>
               <b>"</b><i>value</i><b>"}</b> object per line.
 
               This feature is available in Postfix version 3.11 and later.
@@ -139,58 +142,58 @@ POSTMAP(1)                                                          POSTMAP(1)
 
               This feature is available in Postfix version 2.6 and later.
 
-       <b>-N</b>     Include the terminating null character  that  terminates  lookup
-              keys  and  values.  By  default, <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever is the
+       <b>-N</b>     Include  the  terminating  null character that terminates lookup
+              keys and values. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a>  does  whatever  is  the
               default for the host operating system.
 
-       <b>-n</b>     Don't include the terminating  null  character  that  terminates
-              lookup  keys and values. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever is
+       <b>-n</b>     Don't  include  the  terminating  null character that terminates
+              lookup keys and values. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever  is
               the default for the host operating system.
 
-       <b>-o</b>     Do not release root privileges when processing a non-root  input
-              file.  By  default, <a href="postmap.1.html"><b>postmap</b>(1)</a> drops root privileges and runs as
+       <b>-o</b>     Do  not release root privileges when processing a non-root input
+              file. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> drops root privileges and  runs  as
               the source file owner instead.
 
-       <b>-p</b>     Do not inherit the file access permissions from the  input  file
-              when  creating  a  new  file.   Instead,  create a new file with
+       <b>-p</b>     Do  not  inherit the file access permissions from the input file
+              when creating a new file.   Instead,  create  a  new  file  with
               default access permissions (mode 0644).
 
-       <b>-q</b> <i>key</i> Search the specified maps for <i>key</i>  and  write  the  first  value
-              found  to  the  standard  output stream. The exit status is zero
+       <b>-q</b> <i>key</i> Search  the  specified  maps  for  <i>key</i> and write the first value
+              found to the standard output stream. The  exit  status  is  zero
               when the requested information was found.
 
-              Note: this performs a single query with the  key  as  specified,
-              and  does  not make iterative queries with substrings of the key
-              as described for  <a href="access.5.html">access(5)</a>,  <a href="canonical.5.html">canonical(5)</a>,  <a href="transport.5.html">transport(5)</a>,  <a href="virtual.5.html">vir-</a>
+              Note:  this  performs  a single query with the key as specified,
+              and does not make iterative queries with substrings of  the  key
+              as  described  for  <a href="access.5.html">access(5)</a>,  <a href="canonical.5.html">canonical(5)</a>, <a href="transport.5.html">transport(5)</a>, <a href="virtual.5.html">vir-</a>
               <a href="virtual.5.html">tual(5)</a> and other Postfix table-driven features.
 
-              If  a  key value of <b>-</b> is specified, the program reads key values
-              from the standard input stream and writes one line of <i>key  value</i>
+              If a key value of <b>-</b> is specified, the program reads  key  values
+              from  the standard input stream and writes one line of <i>key value</i>
               output for each key that was found. The exit status is zero when
               at least one of the requested keys was found.
 
-       <b>-r</b>     When updating a table, do not complain about attempts to  update
+       <b>-r</b>     When  updating a table, do not complain about attempts to update
               existing entries, and make those updates anyway.
 
-       <b>-s</b>     Retrieve  all database elements, and write one line of <i>key value</i>
-              output for each element. The elements are  printed  in  database
-              order,  which  is not necessarily the same as the original input
+       <b>-s</b>     Retrieve all database elements, and write one line of <i>key  value</i>
+              output  for  each  element. The elements are printed in database
+              order, which is not necessarily the same as the  original  input
               order.
 
-              This feature is available in Postfix version 2.2 and later,  and
+              This  feature is available in Postfix version 2.2 and later, and
               is not available for all database types.
 
-       <b>-u</b>     Disable  UTF-8 support. UTF-8 support is enabled by default when
-              "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> = yes". It requires that keys  and  values  are
+       <b>-u</b>     Disable UTF-8 support. UTF-8 support is enabled by default  when
+              "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a>  =  yes".  It requires that keys and values are
               valid UTF-8 strings.
 
        <b>-U</b>     With "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> = yes", force UTF-8 syntax checks with the
               <b>-b</b> and <b>-h</b> options.
 
-       <b>-v</b>     Enable verbose  logging  for  debugging  purposes.  Multiple  <b>-v</b>
+       <b>-v</b>     Enable  verbose  logging  for  debugging  purposes.  Multiple <b>-v</b>
               options make the software increasingly verbose.
 
-       <b>-w</b>     When  updating a table, do not complain about attempts to update
+       <b>-w</b>     When updating a table, do not complain about attempts to  update
               existing entries, and ignore those attempts.
 
        Arguments:
@@ -199,38 +202,38 @@ POSTMAP(1)                                                          POSTMAP(1)
               The database type. To find out what types are supported, use the
               "<b>postconf -m</b>" command.
 
-              When  no  <i>file</i><b>_</b><i>type</i> is specified, the software uses the database
-              type  specified  via  the  <b><a href="postconf.5.html#default_database_type">default_database_type</a></b>   configuration
-              parameter.   The default value for this parameter depends on the
+              When no <i>file</i><b>_</b><i>type</i> is specified, the software uses  the  database
+              type   specified  via  the  <b><a href="postconf.5.html#default_database_type">default_database_type</a></b>  configuration
+              parameter.  The default value for this parameter depends on  the
               host environment.
 
               The <a href="postmap.1.html"><b>postmap</b>(1)</a> command can query any supported file type, but it
               can create only the following file types:
 
-              <b>btree</b>  The  output  file  is  a  btree file, named <i>file</i><b>_</b><i>name</i><b>.db</b>.
-                     This is available on systems with support  for  <b>db</b>  data-
+              <b>btree</b>  The output file is  a  btree  file,  named  <i>file</i><b>_</b><i>name</i><b>.db</b>.
+                     This  is  available  on systems with support for <b>db</b> data-
                      bases.
 
-              <b>cdb</b>    The  output  consists  of  one file, named <i>file</i><b>_</b><i>name</i><b>.cdb</b>.
-                     This is available on systems with support for  <b>cdb</b>  data-
+              <b>cdb</b>    The output consists of  one  file,  named  <i>file</i><b>_</b><i>name</i><b>.cdb</b>.
+                     This  is  available on systems with support for <b>cdb</b> data-
                      bases.
 
               <b>dbm</b>    The output consists of two files, named <i>file</i><b>_</b><i>name</i><b>.pag</b> and
                      <i>file</i><b>_</b><i>name</i><b>.dir</b>.  This is available on systems with support
                      for <b>dbm</b> databases.
 
-              <b>fail</b>   A  table that reliably fails all requests. The lookup ta-
-                     ble name is used for logging only. This table  exists  to
+              <b>fail</b>   A table that reliably fails all requests. The lookup  ta-
+                     ble  name  is used for logging only. This table exists to
                      simplify Postfix error tests.
 
-              <b>hash</b>   The  output  file  is  a hashed file, named <i>file</i><b>_</b><i>name</i><b>.db</b>.
-                     This is available on systems with support  for  <b>db</b>  data-
+              <b>hash</b>   The output file is a  hashed  file,  named  <i>file</i><b>_</b><i>name</i><b>.db</b>.
+                     This  is  available  on systems with support for <b>db</b> data-
                      bases.
 
-              <b>lmdb</b>   The  output  is a btree-based file, named <i>file</i><b>_</b><i>name</i><b>.lmdb</b>.
-                     <b>lmdb</b> supports concurrent writes and reads from  different
+              <b>lmdb</b>   The output is a btree-based file,  named  <i>file</i><b>_</b><i>name</i><b>.lmdb</b>.
+                     <b>lmdb</b>  supports concurrent writes and reads from different
                      processes,  unlike  other  supported  file-based  tables.
-                     This is available on systems with support for <b>lmdb</b>  data-
+                     This  is available on systems with support for <b>lmdb</b> data-
                      bases.
 
               <b>sdbm</b>   The output consists of two files, named <i>file</i><b>_</b><i>name</i><b>.pag</b> and
@@ -242,12 +245,12 @@ POSTMAP(1)                                                          POSTMAP(1)
               base.
 
 <b><a name="diagnostics">DIAGNOSTICS</a></b>
-       Problems are logged to the standard error stream and to  <b>syslogd</b>(8)  or
+       Problems  are  logged to the standard error stream and to <b>syslogd</b>(8) or
        <a href="postlogd.8.html"><b>postlogd</b>(8)</a>.  No output means that no problems were detected. Duplicate
        entries are skipped and are flagged with a warning.
 
        <a href="postmap.1.html"><b>postmap</b>(1)</a> terminates with zero exit status in case of success (includ-
-       ing  successful  "<b>postmap -q</b>" lookup) and terminates with non-zero exit
+       ing successful "<b>postmap -q</b>" lookup) and terminates with  non-zero  exit
        status in case of failure.
 
 <b><a name="environment">ENVIRONMENT</a></b>
@@ -258,12 +261,12 @@ POSTMAP(1)                                                          POSTMAP(1)
               Enable verbose logging for debugging purposes.
 
 <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b>
-       The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to  this  pro-
-       gram.   The  text  below  provides  only a parameter summary. See <a href="postconf.5.html"><b>post-</b></a>
+       The  following  <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to this pro-
+       gram.  The text below provides only  a  parameter  summary.  See  <a href="postconf.5.html"><b>post-</b></a>
        <a href="postconf.5.html"><b>conf</b>(5)</a> for more details including examples.
 
        <b><a href="postconf.5.html#berkeley_db_create_buffer_size">berkeley_db_create_buffer_size</a> (16777216)</b>
-              The per-table I/O buffer size for programs that create  Berkeley
+              The  per-table I/O buffer size for programs that create Berkeley
               DB hash or btree tables.
 
        <b><a href="postconf.5.html#berkeley_db_read_buffer_size">berkeley_db_read_buffer_size</a> (131072)</b>
@@ -271,7 +274,7 @@ POSTMAP(1)                                                          POSTMAP(1)
               hash or btree tables.
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The default location of the Postfix <a href="postconf.5.html">main.cf</a> and  <a href="master.5.html">master.cf</a>  con-
+              The  default  location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con-
               figuration files.
 
        <b><a href="postconf.5.html#default_database_type">default_database_type</a> (see 'postconf -d' output)</b>
@@ -279,19 +282,19 @@ POSTMAP(1)                                                          POSTMAP(1)
               and <a href="postmap.1.html"><b>postmap</b>(1)</a> commands.
 
        <b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b>
-              The list of environment  variables  that  a  privileged  Postfix
-              process  will  import  from  a  non-Postfix  parent  process, or
+              The  list  of  environment  variables  that a privileged Postfix
+              process will  import  from  a  non-Postfix  parent  process,  or
               name=value environment overrides.
 
        <b><a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> (yes)</b>
-              Enable preliminary SMTPUTF8 support for the protocols  described
+              Enable  preliminary SMTPUTF8 support for the protocols described
               in <a href="https://tools.ietf.org/html/rfc6531">RFC 6531</a>, <a href="https://tools.ietf.org/html/rfc6532">RFC 6532</a>, and <a href="https://tools.ietf.org/html/rfc6533">RFC 6533</a>.
 
        <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> (see 'postconf -d' output)</b>
-              A  prefix  that  is  prepended  to  the  process  name in syslog
+              A prefix that  is  prepended  to  the  process  name  in  syslog
               records, so that, for example, "smtpd" becomes "prefix/smtpd".
 
        Available in Postfix 2.11 and later:
index ad8f8ba97405b51a5fb7ab2ba1f3dd42cf425aec..e9cce32d64d410fc49ebc4d53b64fd4dab6389ef 100644 (file)
@@ -40,6 +40,14 @@ where a lookup field can match both upper and lower case
 text, such as regexp: and pcre:. This resulted in loss of
 information with $\fInumber\fR substitutions.
 
+In a database file, \fBpostalias\fR(1) stores keys in the external
+(quoted) form. Historically, Postfix versions 3.10 and earlier
+stored the internal (unquoted) form. This was not consistent
+with \fBpostmap\fR(1) behavior. For backwards compatibility,
+Postfix programs will search with the legacy internal form only
+if the preferred external form is not found, and the internal
+and external forms differ.
+
 Options:
 .IP "\fB\-c \fIconfig_dir\fR"
 Read the \fBmain.cf\fR configuration file in the named directory
index 2f74f5e2c45666cb2fcb90b590752e309bf9b677..36ec6e98c379c695abec3a0869be98f3078465b6 100644 (file)
@@ -49,7 +49,10 @@ surrounding white space is stripped off. Whitespace in lookup
 keys is supported in Postfix 3.2 and later, by surrounding the
 key with double quote characters `"'. Within the double quotes,
 double quote `"' and backslash `\\' characters can be included
-by quoting them with a preceding backslash.
+by quoting them with a preceding backslash. For backwards
+compatibility, Postfix programs will search with the legacy
+internal form only if the preferred external form is not found,
+and the internal and external forms differ.
 
 When the \fB\-F\fR option is given, the \fIvalue\fR must
 specify one or more filenames separated by comma and/or
index f7dc6c0435f3250583da7ef327add58cac258d53..ab1eb020b57ba72f35cd14c9647324713199f981 100644 (file)
@@ -228,3 +228,5 @@ proto  proto stop proto stop double cc
  proto stop spell proto html postfix postfix c conf postfix files 
  File nbdb_reindexd nbdb_reindexd c 
  tls tls h tls tls_misc c tls tls_verify c 
+ differ Files postalias postalias c local alias c 
+ local local hc local Makefile 
index 192c871aac9ee887bc56c11272f216146c8005cd..72e3957e63f9c21637e5f918161c5129b5a1a556 100644 (file)
@@ -1914,3 +1914,5 @@ reindexed
 reindexing
 surr
 whoami
+IfChange
+ThenChange
index 554c8865de691b27693e43b5699b0b0bf4e36d66..924d594ea79325fa0e69bd8faa6c6d4a60405f43 100644 (file)
@@ -132,3 +132,6 @@ Scheiner
 Avram
 Berindeie
 Teodor
+IfThisThenThat
+linter
+MAXINT
index 5c993bf961d4b169524ba45f159e563dbd1ad111..ad40269ce7831192213bb0360bbe0a7a1417f1fb 100644 (file)
@@ -31,7 +31,7 @@ SRCS  = abounce.c anvil_clnt.c been_here.c bounce.c bounce_log.c \
        match_service.c mail_conf_nint.c addr_match_list.c mail_conf_nbool.c \
        smtp_reply_footer.c safe_ultostr.c verify_sender_addr.c \
        dict_memcache.c mail_version.c memcache_proto.c server_acl.c \
-       haproxy_srvr.c dsn_filter.c dynamicmaps.c uxtext.c \
+       haproxy_srvr.c dsn_filter.c uxtext.c \
        smtputf8.c mail_conf_over.c mail_parm_split.c midna_adomain.c \
        mail_addr_form.c quote_flags.c maillog_client.c \
        normalize_mailhost_addr.c map_search.c reject_deliver_request.c \
@@ -72,7 +72,7 @@ OBJS  = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \
        match_service.o mail_conf_nint.o addr_match_list.o mail_conf_nbool.o \
        smtp_reply_footer.o safe_ultostr.o verify_sender_addr.o \
        dict_memcache.o mail_version.o memcache_proto.o server_acl.o \
-       haproxy_srvr.o dsn_filter.o dynamicmaps.o uxtext.o \
+       haproxy_srvr.o dsn_filter.o uxtext.o \
        smtputf8.o attr_override.o mail_parm_split.o midna_adomain.o \
        $(NON_PLUGIN_MAP_OBJ) mail_addr_form.o quote_flags.o maillog_client.o \
        normalize_mailhost_addr.o map_search.o reject_deliver_request.o \
@@ -112,7 +112,7 @@ HDRS        = abounce.h anvil_clnt.h been_here.h bounce.h bounce_log.h \
        fold_addr.h header_body_checks.h data_redirect.h match_service.h \
        addr_match_list.h smtp_reply_footer.h safe_ultostr.h \
        verify_sender_addr.h dict_memcache.h memcache_proto.h server_acl.h \
-       haproxy_srvr.h dsn_filter.h dynamicmaps.h uxtext.h smtputf8.h \
+       haproxy_srvr.h dsn_filter.h uxtext.h smtputf8.h \
        attr_override.h mail_parm_split.h midna_adomain.h mail_addr_form.h \
        maillog_client.h normalize_mailhost_addr.h map_search.h \
        info_log_addr_form.h sasl_mech_filter.h login_sender_match.h \
@@ -136,7 +136,7 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \
        verify_clnt xtext anvil_clnt scache ehlo_mask_test \
        valid_mailhost_addr own_inet_addr header_body_checks \
        data_redirect addr_match_list safe_ultostr verify_sender_addr \
-       mail_version mail_dict server_acl uxtext mail_parm_split \
+       mail_dict server_acl uxtext mail_parm_split \
        fold_addr smtp_reply_footer mail_addr_map normalize_mailhost_addr \
        haproxy_srvr_test map_search delivered_hdr login_sender_match_test \
        compat_level config_known_tcp_ports hfrom_format rfc2047_code \
@@ -446,7 +446,7 @@ config_known_tcp_ports: config_known_tcp_ports.c $(LIB) $(LIBS)
 tests: tok822_test mime_tests strip_addr_test tok822_limit_test \
        xtext_test scache_multi_test test_ehlo_mask \
        namadr_list_test mail_conf_time_test header_body_checks_tests \
-       mail_version_test server_acl_test resolve_local_test maps_test \
+       server_acl_test resolve_local_test maps_test \
        safe_ultostr_test mail_parm_split_test fold_addr_test \
        smtp_reply_footer_test off_cvt_test mail_addr_crunch_test \
        mail_addr_find_test mail_addr_map_test quote_822_local_test \
@@ -549,11 +549,6 @@ xtext_test: xtext
        cmp xtext.ref xtext.tmp
        rm -f xtext.ref xtext.tmp
 
-mail_version_test: mail_version mail_version.in mail_version.ref
-       $(SHLIB_ENV) $(VALGRIND) ./mail_version <mail_version.in >mail_version.tmp
-       diff  mail_version.ref mail_version.tmp
-       rm -f mail_version.tmp
-
 server_acl_test: server_acl server_acl.in server_acl.ref
        $(SHLIB_ENV) $(VALGRIND) ./server_acl <server_acl.in >server_acl.tmp 2>&1
        diff  server_acl.ref server_acl.tmp
@@ -1525,25 +1520,6 @@ dsn_util.o: ../../include/vbuf.h
 dsn_util.o: ../../include/vstring.h
 dsn_util.o: dsn_util.c
 dsn_util.o: dsn_util.h
-dynamicmaps.o: ../../include/argv.h
-dynamicmaps.o: ../../include/check_arg.h
-dynamicmaps.o: ../../include/dict.h
-dynamicmaps.o: ../../include/htable.h
-dynamicmaps.o: ../../include/load_lib.h
-dynamicmaps.o: ../../include/mkmap.h
-dynamicmaps.o: ../../include/msg.h
-dynamicmaps.o: ../../include/myflock.h
-dynamicmaps.o: ../../include/mymalloc.h
-dynamicmaps.o: ../../include/scan_dir.h
-dynamicmaps.o: ../../include/split_at.h
-dynamicmaps.o: ../../include/stringops.h
-dynamicmaps.o: ../../include/sys_defs.h
-dynamicmaps.o: ../../include/vbuf.h
-dynamicmaps.o: ../../include/vstream.h
-dynamicmaps.o: ../../include/vstring.h
-dynamicmaps.o: ../../include/vstring_vstream.h
-dynamicmaps.o: dynamicmaps.c
-dynamicmaps.o: dynamicmaps.h
 ehlo_mask.o: ../../include/check_arg.h
 ehlo_mask.o: ../../include/name_mask.h
 ehlo_mask.o: ../../include/sys_defs.h
@@ -2020,6 +1996,7 @@ mail_date.o: mail_date.h
 mail_dict.o: ../../include/argv.h
 mail_dict.o: ../../include/check_arg.h
 mail_dict.o: ../../include/dict.h
+mail_dict.o: ../../include/dynamicmaps.h
 mail_dict.o: ../../include/mkmap.h
 mail_dict.o: ../../include/msg.h
 mail_dict.o: ../../include/myflock.h
@@ -2036,7 +2013,6 @@ mail_dict.o: dict_mysql.h
 mail_dict.o: dict_pgsql.h
 mail_dict.o: dict_proxy.h
 mail_dict.o: dict_sqlite.h
-mail_dict.o: dynamicmaps.h
 mail_dict.o: mail_dict.c
 mail_dict.o: mail_dict.h
 mail_dict.o: mail_params.h
index 5a725d76572ef6b26e9c4e399d8c80bdd02f19c7..25265744fced1e41bf9e167f8ea738911753d8f9 100644 (file)
@@ -47,6 +47,7 @@ extern const char *mail_addr_find_opt(MAPS *, const char *, char **,
            MA_FORM_EXTERNAL, MA_FIND_DEFAULT)
 
  /* The legacy forms. */
+ /* LINT.IfChange */
 #define MA_FIND_FORM_LEGACY \
        MA_FORM_INTERNAL, MA_FORM_EXTERNAL_FIRST, \
            MA_FORM_EXTERNAL
@@ -62,6 +63,7 @@ extern const char *mail_addr_find_opt(MAPS *, const char *, char **,
 #define mail_addr_find_to_internal(maps, address, extension) \
        mail_addr_find_opt((maps), (address), (extension), \
            MA_FIND_FORM_LEGACY, MA_FIND_DEFAULT)
+ /* LINT.ThenChange(../local/alias.c) */
 
 /* LICENSE
 /* .ad
index 083789ce47e84347ec91635f988bb1c9abf8bc31..0fbd7cb08da9a01cac6e6e126ccf277546187c81 100644 (file)
 
 #include <mail_version.h>
 
-/* mail_version_int - convert integer */
-
-static int mail_version_int(const char *strval)
-{
-    char   *end;
-    int     intval;
-    long    longval;
-
-    errno = 0;
-    intval = longval = strtol(strval, &end, 10);
-    if (*strval == 0 || *end != 0 || errno == ERANGE || longval != intval)
-       intval = (-1);
-    return (intval);
-}
-
-/* mail_version_worker - do the parsing work */
-
-static const char *mail_version_worker(MAIL_VERSION *mp, char *cp)
-{
-    char   *major_field;
-    char   *minor_field;
-    char   *patch_field;
-
-    /*
-     * Program name.
-     */
-    if (*cp == '-' || (mp->program = mystrtok(&cp, "-")) == 0)
-       return ("no program name");
-
-    /*
-     * Major, minor, patchlevel. If this is a stable release, then we ignore
-     * text after the patchlevel, in case there are vendor extensions.
-     */
-    if ((major_field = mystrtok(&cp, "-")) == 0)
-       return ("missing major version");
-
-    if ((minor_field = split_at(major_field, '.')) == 0)
-       return ("missing minor version");
-    if ((mp->major = mail_version_int(major_field)) < 0)
-       return ("bad major version");
-    patch_field = split_at(minor_field, '.');
-    if ((mp->minor = mail_version_int(minor_field)) < 0)
-       return ("bad minor version");
-
-    if (patch_field == 0)
-       mp->patch = -1;
-    else if ((mp->patch = mail_version_int(patch_field)) < 0)
-       return ("bad patchlevel");
-
-    /*
-     * Experimental release. If this is not a stable release, we take
-     * everything to the end of the string.
-     */
-    if (patch_field != 0)
-       mp->snapshot = 0;
-    else if ((mp->snapshot = mystrtok(&cp, "")) == 0)
-       return ("missing snapshot field");
-
-    return (0);
-}
-
-/* mail_version_parse - driver */
-
-MAIL_VERSION *mail_version_parse(const char *string, const char **why)
-{
-    MAIL_VERSION *mp;
-    char   *saved_string;
-    const char *err;
-
-    mp = (MAIL_VERSION *) mymalloc(sizeof(*mp));
-    saved_string = mystrdup(string);
-    if ((err = mail_version_worker(mp, saved_string)) != 0) {
-       *why = err;
-       myfree(saved_string);
-       myfree((void *) mp);
-       return (0);
-    } else {
-       return (mp);
-    }
-}
-
-/* mail_version_free - destroy version information */
-
-void    mail_version_free(MAIL_VERSION *mp)
-{
-    myfree(mp->program);
-    myfree((void *) mp);
-}
-
-/* get_mail_version - return parsed mail version string */
-
-const char *get_mail_version(void)
-{
-    return (DEF_MAIL_VERSION);
-}
-
 /* check_mail_version - compare caller version with library version */
 
 void    check_mail_version(const char *version_string)
@@ -193,66 +97,3 @@ void    check_mail_version(const char *version_string)
        msg_warn("Postfix library version mis-match: wanted %s, found %s",
                 version_string, DEF_MAIL_VERSION);
 }
-
-#ifdef TEST
-
-#include <unistd.h>
-#include <vstring.h>
-#include <vstream.h>
-#include <vstring_vstream.h>
-
-#define STR(x) vstring_str(x)
-
-/* parse_sample - parse a sample string from argv or stdin */
-
-static void parse_sample(const char *sample)
-{
-    MAIL_VERSION *mp;
-    const char *why;
-
-    mp = mail_version_parse(sample, &why);
-    if (mp == 0) {
-       vstream_printf("ERROR: %s: %s\n", sample, why);
-    } else {
-       vstream_printf("program: %s\t", mp->program);
-       vstream_printf("major: %d\t", mp->major);
-       vstream_printf("minor: %d\t", mp->minor);
-       if (mp->patch < 0)
-           vstream_printf("snapshot: %s\n", mp->snapshot);
-       else
-           vstream_printf("patch: %d\n", mp->patch);
-       mail_version_free(mp);
-    }
-    vstream_fflush(VSTREAM_OUT);
-}
-
-/* main - the main program */
-
-int     main(int argc, char **argv)
-{
-    VSTRING *inbuf = vstring_alloc(1);
-    int     have_tty = isatty(0);
-
-    if (argc > 1) {
-       while (--argc > 0 && *++argv)
-           parse_sample(*argv);
-    } else {
-       for (;;) {
-           if (have_tty) {
-               vstream_printf("> ");
-               vstream_fflush(VSTREAM_OUT);
-           }
-           if (vstring_fgets_nonl(inbuf, VSTREAM_IN) <= 0)
-               break;
-           if (have_tty == 0)
-               vstream_printf("> %s\n", STR(inbuf));
-           if (*STR(inbuf) == 0 || *STR(inbuf) == '#')
-               continue;
-           parse_sample(STR(inbuf));
-       }
-    }
-    vstring_free(inbuf);
-    return (0);
-}
-
-#endif
index cf3f6344706754ff223a444b30feefda3a5bcd5b..5fa1d0ffbabaa7b394a64aa33e90a86965353a45 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20260310"
+#define MAIL_RELEASE_DATE      "20260312"
 #define MAIL_VERSION_NUMBER    "3.12"
 
 #ifdef SNAPSHOT
@@ -67,24 +67,6 @@ extern char *var_mail_release;
 #define MAIL_VERSION_STAMP_ALLOCATE \
     mail_version_stamp = strdup(VAR_MAIL_VERSION "=" DEF_MAIL_VERSION)
 
- /*
-  * Mail version string parser, plus support to compare the compile-time
-  * version string of a Postfix program with the run-time version string of a
-  * Postfix shared library. When programs are not updated, they may fail in
-  * erratic ways when linked against a newer run-time library. Of course the
-  * right solution is so-number versioning of the Postfix run-time library.
-  */
-typedef struct {
-    char   *program;                   /* postfix */
-    int     major;                     /* 2 */
-    int     minor;                     /* 9 */
-    int     patch;                     /* null */
-    char   *snapshot;                  /* 20111209-nonprod */
-} MAIL_VERSION;
-
-extern MAIL_VERSION *mail_version_parse(const char *, const char **);
-extern void mail_version_free(MAIL_VERSION *);
-extern const char *get_mail_version(void);
 extern void check_mail_version(const char *);
 
 #define MAIL_VERSION_CHECK \
index b1b7012b6d7a79c60219a824aa44e50582694552..afdbab46d8e3c9857fe54d6586d6a451dade74e8 100644 (file)
@@ -79,6 +79,8 @@ alias.o: ../../include/mymalloc.h
 alias.o: ../../include/mypwd.h
 alias.o: ../../include/nvtable.h
 alias.o: ../../include/pol_stats.h
+alias.o: ../../include/quote_822_local.h
+alias.o: ../../include/quote_flags.h
 alias.o: ../../include/recipient_list.h
 alias.o: ../../include/resolve_clnt.h
 alias.o: ../../include/sent.h
index ae47a5792f0379336871045611044ca87c4e1b31..53e750b1931c0f699b29a96e670d98b72fa37b21 100644 (file)
@@ -87,6 +87,7 @@
 #include <sent.h>
 #include <trace.h>
 #include <dsn_mask.h>
+#include <quote_822_local.h>
 
 /* Application-specific. */
 
 #define NO     0
 #define YES    1
 
+/* get_alias - look up alias expansion, with legacy search key support */
+
+static const char *get_alias(LOCAL_STATE state, DICT *dict, const char *name)
+{
+    const char *alias_result;
+
+    /*
+     * The legacy query with the unquoted form should be removed when the
+     * legacy strategy is removed in mail_addr_find.h.
+     */
+    quote_822_local_flags(state.alias_key, name, QUOTE_FLAG_DEFAULT
+                         | QUOTE_FLAG_BARE_LOCALPART);
+    alias_result = dict_get(dict, STR(state.alias_key));
+    /* LINT.IfChange */
+    if (alias_result == 0 && dict->error == 0
+       && strcmp(name, STR(state.alias_key)) != 0)
+       alias_result = dict_get(dict, name);
+    /* LINT.ThenChange(../global/mail_addr_find.h) */
+    return (alias_result);
+}
+
 /* deliver_alias - expand alias file entry */
 
 int     deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
@@ -172,7 +194,7 @@ int     deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
     for (cpp = alias_maps->argv->argv; *cpp; cpp++) {
        if ((dict = dict_handle(*cpp)) == 0)
            msg_panic("%s: dictionary not found: %s", myname, *cpp);
-       if ((alias_result = dict_get(dict, name)) != 0) {
+       if ((alias_result = get_alias(state, dict, name)) != 0) {
            if (msg_verbose)
                msg_info("%s: %s: %s = %s", myname, *cpp, name, alias_result);
 
index 7ff047d1edca888e846c483bb3983a3981488710..e0272eb49c55f490bfe32ebcb770874aeed05c4b 100644 (file)
@@ -762,6 +762,7 @@ static int local_deliver(DELIVER_REQUEST *rqst, char *service)
     state.loop_info = delivered_hdr_init(rqst->fp, rqst->data_offset,
                                         FOLD_ADDR_ALL);
     state.request = rqst;
+    state.alias_key = vstring_alloc(100);
 
     /*
      * Iterate over each recipient named in the delivery request. When the
@@ -786,6 +787,7 @@ static int local_deliver(DELIVER_REQUEST *rqst, char *service)
      */
     delivered_hdr_free(state.loop_info);
     deliver_attr_free(&state.msg_attr);
+    vstring_free(state.alias_key);
 
     return (msg_stat);
 }
index 0f024e45f09a4aca9ad687710678227a84682256..98655df10669dda57ea336c3e25ae1f3fb8b3bb1 100644 (file)
@@ -111,6 +111,7 @@ typedef struct LOCAL_STATE {
     BH_TABLE *dup_filter;              /* internal duplicate filter */
     DELIVERED_HDR_INFO *loop_info;     /* external loop filter */
     DELIVER_REQUEST *request;          /* as from queue manager */
+    VSTRING *alias_key;                        /* external-form search key */
 } LOCAL_STATE;
 
 #define RESET_OWNER_ATTR(msg_attr, level) { \
index eff1efbd421975a00e14c34be91530f5cc189620..eec322f4fc14c4cb85c2d9fa55c2d7600d6bb94f 100644 (file)
 /*     text, such as regexp: and pcre:. This resulted in loss of
 /*     information with $\fInumber\fR substitutions.
 /*
+/*     In a database file, \fBpostalias\fR(1) stores keys in the external
+/*     (quoted) form. Historically, Postfix versions 3.10 and earlier
+/*     stored the internal (unquoted) form. This was not consistent
+/*     with \fBpostmap\fR(1) behavior. For backwards compatibility,
+/*     Postfix programs will search with the legacy internal form only
+/*     if the preferred external form is not found, and the internal
+/*     and external forms differ.
+/*
 /*     Options:
 /* .IP "\fB-c \fIconfig_dir\fR"
 /*     Read the \fBmain.cf\fR configuration file in the named directory
@@ -462,7 +470,7 @@ static void postalias(char *map_type, char *path_name, int postalias_flags,
            tok822_unlink(colon);
            tok822_free(colon);
 
-           tok822_internalize(key_buffer, key_list, TOK822_STR_DEFL);
+           tok822_externalize(key_buffer, key_list, TOK822_STR_DEFL);
            tok822_free_tree(key_list);
 
            tok822_externalize(value_buffer, value_list, TOK822_STR_DEFL);
index 7b9c8e64ca049e9990c92e02bc9c8159a473da6b..c23b80b50552a706fc0256c2380a55fc2ee7a54b 100644 (file)
 /*     keys is supported in Postfix 3.2 and later, by surrounding the
 /*     key with double quote characters `"'. Within the double quotes,
 /*     double quote `"' and backslash `\\' characters can be included
-/*     by quoting them with a preceding backslash.
+/*     by quoting them with a preceding backslash. For backwards
+/*     compatibility, Postfix programs will search with the legacy
+/*     internal form only if the preferred external form is not found,
+/*     and the internal and external forms differ.
 /*
 /*     When the \fB-F\fR option is given, the \fIvalue\fR must
 /*     specify one or more filenames separated by comma and/or
index c70cf5c3a2196556025eb54033b43f8e2a2e7eb8..770dd7734c033f17ed8e1a40a04961cb51d2e0a6 100644 (file)
@@ -48,7 +48,7 @@ SRCS  = alldig.c allprint.c argv.c argv_split.c attr_clnt.c attr_print0.c \
        inet_addr_sizes.c quote_for_json.c mystrerror.c \
        sane_sockaddr_to_hostaddr.c normalize_ws.c valid_uri_scheme.c \
        clean_ascii_cntrl_space.c normalize_v4mapped_addr.c ossl_digest.c \
-       mac_midna.c wrap_stat.c
+       mac_midna.c wrap_stat.c dynamicmaps.c
 OBJS   = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \
        attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \
        attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \
@@ -97,7 +97,8 @@ OBJS  = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \
        mkmap_fail.o mkmap_open.o inet_prefix_top.o inet_addr_sizes.o \
        quote_for_json.o mystrerror.o sane_sockaddr_to_hostaddr.o \
        normalize_ws.o valid_uri_scheme.o clean_ascii_cntrl_space.o \
-       normalize_v4mapped_addr.o ossl_digest.o mac_midna.o wrap_stat.o
+       normalize_v4mapped_addr.o ossl_digest.o mac_midna.o wrap_stat.o \
+       dynamicmaps.o
 # MAP_OBJ is for maps that may be dynamically loaded with dynamicmaps.cf.
 # When hard-linking these, makedefs sets NON_PLUGIN_MAP_OBJ=$(MAP_OBJ),
 # otherwise it sets the PLUGIN_* macros.
@@ -132,7 +133,7 @@ HDRS        = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \
        known_tcp_ports.h sane_strtol.h hash_fnv.h ldseed.h mkmap.h \
        inet_prefix_top.h inet_addr_sizes.h valid_uri_scheme.h \
        clean_ascii_cntrl_space.h normalize_v4mapped_addr.h ossl_digest.h \
-       mac_midna.h wrap_stat.h
+       mac_midna.h wrap_stat.h dynamicmaps.h
 TESTSRC        = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
        stream_test.c dup2_pass_on_exec.c
 DEFS   = -I. -D$(SYSTYPE)
@@ -1992,6 +1993,25 @@ duplex_pipe.o: duplex_pipe.c
 duplex_pipe.o: iostuff.h
 duplex_pipe.o: sane_socketpair.h
 duplex_pipe.o: sys_defs.h
+dynamicmaps.o: argv.h
+dynamicmaps.o: check_arg.h
+dynamicmaps.o: dict.h
+dynamicmaps.o: dynamicmaps.c
+dynamicmaps.o: dynamicmaps.h
+dynamicmaps.o: htable.h
+dynamicmaps.o: load_lib.h
+dynamicmaps.o: mkmap.h
+dynamicmaps.o: msg.h
+dynamicmaps.o: myflock.h
+dynamicmaps.o: mymalloc.h
+dynamicmaps.o: scan_dir.h
+dynamicmaps.o: split_at.h
+dynamicmaps.o: stringops.h
+dynamicmaps.o: sys_defs.h
+dynamicmaps.o: vbuf.h
+dynamicmaps.o: vstream.h
+dynamicmaps.o: vstring.h
+dynamicmaps.o: vstring_vstream.h
 edit_file.o: check_arg.h
 edit_file.o: edit_file.c
 edit_file.o: edit_file.h
similarity index 99%
rename from postfix/src/global/dynamicmaps.c
rename to postfix/src/util/dynamicmaps.c
index 0b66ab9f8d7d343d2297c4db771fd153214f06ae..52c17bb1a0d7b24a3dfd11c9321afdcf6d081d49 100644 (file)
 #include <stringops.h>
 #include <split_at.h>
 #include <scan_dir.h>
-
- /*
-  * Global library.
-  */
 #include <dynamicmaps.h>
 
 #ifdef USE_DYNAMIC_MAPS