]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.7-20100102
authorWietse Venema <wietse@porcupine.org>
Sat, 2 Jan 2010 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:35:56 +0000 (06:35 +0000)
19 files changed:
postfix/HISTORY
postfix/README_FILES/ADDRESS_VERIFICATION_README
postfix/html/ADDRESS_VERIFICATION_README.html
postfix/html/postconf.5.html
postfix/html/verify.8.html
postfix/html/virtual.8.html
postfix/man/man5/postconf.5
postfix/man/man8/verify.8
postfix/man/man8/virtual.8
postfix/proto/ADDRESS_VERIFICATION_README.html
postfix/proto/postconf.proto
postfix/src/global/mail_version.h
postfix/src/util/Makefile.in
postfix/src/util/dict_db.c
postfix/src/util/dict_open.c
postfix/src/util/dict_seq.in [new file with mode: 0644]
postfix/src/util/dict_seq.ref [new file with mode: 0644]
postfix/src/verify/verify.c
postfix/src/virtual/virtual.c

index 7e074741d9b6aaeeac0bda936e9e523d221c9691..f2c8f7bc2f960e344fcf86063441888e9a99e77e 100644 (file)
@@ -15615,3 +15615,9 @@ Apologies for any names omitted.
        Bugfix: the mantools/postlink script applied hyperlinks
        for the "virtual:" transport to "/etc/postfix/virtual:".
        Symptom reported by Christoph Anton Mitterer.
+
+20200102
+
+       Workaround: don't report bogus Berkeley DB close errors as
+       fatal errors. All operations before close are already error
+       checked, so the data is known to be safe.  File: util/dict_db.c.
index 08d717242e6d4890170aa05674f346263017ff7f..3251de38e29c1d39824de79554ef36c1b39afa19 100644 (file)
@@ -261,54 +261,56 @@ probe fails with some temporary error.
 
 A\bAd\bdd\bdr\bre\bes\bss\bs v\bve\ber\bri\bif\bfi\bic\bca\bat\bti\bio\bon\bn d\bda\bat\bta\bab\bba\bas\bse\be
 
-NOTE: By default, address verification information is not stored in a
-persistent file. You have to specify one in main.cf (see below). Persistent
-storage is off by default because it may need more disk space than is available
-in your file system.
-
-Address verification information is cached by the Postfix verify daemon.
-Postfix has a bunch of parameters that control the caching of positive and
-negative results. Refer to the verify(8) manual page for details.
-
-The address_verify_map (NOTE: singular) configuration parameter specifies an
-optional database for sender or recipient address verification results. If you
-don't specify a file, all address verification information is lost after
-"postfix reload" or "postfix stop".
-
-If your /var file system has sufficient space, try:
+To improve performance, the Postfix verify(8) daemon can save address
+verification results to a persistent database. The address_verify_map (NOTE:
+singular) configuration parameter specifies persistent storage for sender or
+recipient address verification results. If you specify an empty value, all
+address verification results are lost after "postfix reload" or "postfix stop".
 
     /etc/postfix/main.cf:
+        # Default setting for Postfix 2.7 and later.
         # Note: avoid hash files here. Use btree instead.
-        address_verify_map = btree:/var/lib/postfix/verify
+        address_verify_map = btree:$data_directory/verify_cache
 
-NOTE 1: As of version 2.5, Postfix no longer uses root privileges when opening
-this file. The file should now be stored under the Postfix-owned
-data_directory. As a migration aid, an attempt to open the file under a non-
-Postfix directory is redirected to the Postfix-owned data_directory, and a
-warning is logged. If you wish to continue using a pre-existing database file,
-move it to the data_directory, and change ownership to the account specified
-with the mail_owner parameter.
+        # Default setting for Postfix 2.6 and earlier.
+        # This uses non-persistent storage only.
+        address_verify_map =
+
+NOTE 1: The database file should be stored under a Postfix-owned directory,
+such as $data_directory.
+
+    As of version 2.5, Postfix no longer uses root privileges when opening this
+    file. To maintain backwards compatibility, an attempt to open the file
+    under a non-Postfix directory is redirected to the Postfix-owned
+    data_directory, and a warning is logged. If you wish to continue using a
+    pre-existing database file, change its file ownership to the account
+    specified with the mail_owner parameter, and either move the file to the
+    data_directory, or move it to some other Postfix-owned directory.
 
 NOTE 2: Do not put this file in a file system that may run out of space. When
 the address verification table gets corrupted the world comes to an end and YOU
 will have to MANUALLY fix things as described in the next section. Meanwhile,
 you will not receive mail via SMTP.
 
-NOTE 3: The verify(8) daemon process will create a new database when none
-exists, and will open/create the file before it enters the chroot jail.
+NOTE 3: The verify(8) daemon will create a new database when none exists. It
+will open or create the file before entering the chroot jail.
 
 M\bMa\ban\bna\bag\bgi\bin\bng\bg t\bth\bhe\be a\bad\bdd\bdr\bre\bes\bss\bs v\bve\ber\bri\bif\bfi\bic\bca\bat\bti\bio\bon\bn d\bda\bat\bta\bab\bba\bas\bse\be
 
-The verify(8) manual page describes parameters that control how long
-information remains cached before it needs to be refreshed, and how long
-information can remain "unrefreshed" before it expires. Postfix uses different
+The verify(8) manual page describes parameters that control how long address
+verification results are cached before they need to be refreshed, and how long
+results can remain "unrefreshed" before they expire. Postfix uses different
 controls for positive results (address was accepted) and for negative results
-(address was rejected).
+(address was rejected, or address verification failed for some other reason).
+
+Current Postfix versions will periodically remove expired entries from the
+address verification database. With Postfix version 2.6 and earlier, database
+cleanup had to be done as described next.
 
-Right now, no tools are provided to manage the address verification database.
-If the file gets too big, or if it gets corrupted, you can manually rename or
-delete the file and run "postfix reload". The new verify daemon process will
-then create a new database.
+If the address verification database file becomes too big, or if it becomes
+corrupted, the solution is to manually rename or delete (NOT: truncate) the
+file and run "postfix reload". The verify(8) daemon will then create a new
+database file.
 
 C\bCo\bon\bnt\btr\bro\bol\bll\bli\bin\bng\bg t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg o\bof\bf a\bad\bdd\bdr\bre\bes\bss\bs v\bve\ber\bri\bif\bfi\bic\bca\bat\bti\bio\bon\bn p\bpr\bro\bob\bbe\bes\bs
 
index 98132aa2fd7a29287a2a198e94d621d5df2b503a..3e92d10ce09ce27cddf700e47cb06723677e7a10 100644 (file)
@@ -402,40 +402,37 @@ sender address verification probe fails with some temporary error.
 
 <h2><a name="caching">Address verification database</a></h2>
 
-<p> NOTE: By default, address verification information is not stored
-in a persistent file. You have to specify one in <a href="postconf.5.html">main.cf</a> (see
-below). Persistent storage is off by default because it may need
-more disk space than is available in your file system. </p>
-
-<p> Address verification information is cached by the Postfix verify
-daemon.  Postfix has a bunch of parameters that control the caching
-of positive and negative results. Refer to the <a href="verify.8.html">verify(8)</a> manual
-page for details. </p>
-
-<p> The <a href="postconf.5.html#address_verify_map">address_verify_map</a> (NOTE: singular) configuration parameter
-specifies an optional database for sender or recipient address
-verification results.  If you don't specify a file, all address
-verification information is lost after "postfix reload" or "postfix
-stop". </p>
-
-<p> If your /var file system has sufficient space, try: </p>
+<p> To improve performance, the Postfix <a href="verify.8.html">verify(8)</a> daemon can save
+address verification results to a persistent database.  The
+<a href="postconf.5.html#address_verify_map">address_verify_map</a> (NOTE: singular) configuration parameter specifies
+persistent storage for sender or recipient address verification
+results.  If you specify an empty value, all address verification
+results are lost after "postfix reload" or "postfix stop". </p>
 
 <blockquote>
 <pre>
 /etc/postfix/<a href="postconf.5.html">main.cf</a>:
+    # Default setting for Postfix 2.7 and later.
     # Note: avoid hash files here. Use btree instead.
-    <a href="postconf.5.html#address_verify_map">address_verify_map</a> = btree:/var/lib/postfix/verify
+    <a href="postconf.5.html#address_verify_map">address_verify_map</a> = btree:$<a href="postconf.5.html#data_directory">data_directory</a>/verify_cache
+
+    # Default setting for Postfix 2.6 and earlier.
+    # This uses non-persistent storage only.
+    <a href="postconf.5.html#address_verify_map">address_verify_map</a> =
 </pre>
 </blockquote>
 
-<p> NOTE 1: As of version 2.5, Postfix no longer uses root privileges
-when opening this file. The file should now be stored under the
-Postfix-owned <a href="postconf.5.html#data_directory">data_directory</a>. As a migration aid, an attempt to
-open the file under a non-Postfix directory is redirected to the
-Postfix-owned <a href="postconf.5.html#data_directory">data_directory</a>, and a warning is logged. If you wish
-to continue using a pre-existing database file, move it to the
-<a href="postconf.5.html#data_directory">data_directory</a>, and change ownership to the account specified with
-the <a href="postconf.5.html#mail_owner">mail_owner</a> parameter.  </p>
+<p> NOTE 1: The database file should be stored under a Postfix-owned
+directory, such as $<a href="postconf.5.html#data_directory">data_directory</a>. </p>
+
+<blockquote> As of version 2.5, Postfix no longer uses root privileges
+when opening this file. To maintain backwards compatibility, an
+attempt to open the file under a non-Postfix directory is redirected
+to the Postfix-owned <a href="postconf.5.html#data_directory">data_directory</a>, and a warning is logged. If
+you wish to continue using a pre-existing database file, change its
+file ownership to the account specified with the <a href="postconf.5.html#mail_owner">mail_owner</a> parameter,
+and either move the file to the <a href="postconf.5.html#data_directory">data_directory</a>, or move it to some
+other Postfix-owned directory.  </blockquote>
 
 <p> NOTE 2: Do not put this file in a file system that may run out
 of space.  When the address verification table gets corrupted the
@@ -443,23 +440,28 @@ world comes to an end and YOU will have to MANUALLY fix things as
 described in the next section. Meanwhile, you will not receive mail
 via SMTP. </p>
 
-<p> NOTE 3: The <a href="verify.8.html">verify(8)</a> daemon process will create a new database when
-none exists, and will open/create the file before it enters the
+<p> NOTE 3: The <a href="verify.8.html">verify(8)</a> daemon will create a new database when
+none exists. It will open or create the file before entering the
 chroot jail. </p>
 
 <h2><a name="dirty_secret">Managing the address verification
 database</a></h2>
 
-<p> The <a href="verify.8.html">verify(8)</a> manual page describes parameters that control
-how long information remains cached before it needs to be refreshed,
-and how long information can remain "unrefreshed" before it expires.
-Postfix uses different controls for positive results (address was
-accepted) and for negative results (address was rejected). </p>
-
-<p> Right now, no tools are provided to manage the address verification
-database. If the file gets too big, or if it gets corrupted, you
-can manually rename or delete the file and run "postfix reload".
-The new verify daemon process will then create a new database. </p>
+<p> The <a href="verify.8.html">verify(8)</a> manual page describes parameters that control how
+long address verification results are cached before they need to
+be refreshed, and how long results can remain "unrefreshed" before
+they expire.  Postfix uses different controls for positive results
+(address was accepted) and for negative results (address was rejected,
+or address verification failed for some other reason). </p>
+
+<p> Current Postfix versions will periodically remove expired entries
+from the address verification database. With Postfix version 2.6
+and earlier, database cleanup had to be done as described next. </p>
+
+<p> If the address verification database file becomes too big, or
+if it becomes corrupted, the solution is to manually rename or
+delete (NOT: truncate) the file and run "postfix reload".  The
+<a href="verify.8.html">verify(8)</a> daemon will then create a new database file.  </p>
 
 <h2><a name="probe_routing">Controlling the routing of address
 verification probes</a></h2>
index 9bae584ca598033e145c933f453048a045b9f4f5..955936e0066332100ef17cdbfb25b4ff24b77c6a 100644 (file)
@@ -124,11 +124,10 @@ Do not change this unless you have a complete understanding of <a href="http://t
 <DT><b><a name="address_verify_cache_cleanup_interval">address_verify_cache_cleanup_interval</a>
 (default: 12h)</b></DT><DD>
 
-<p> The amount of time between <a href="verify.8.html">verify(8)</a> cache cleanup runs.  Cache
-cleanup increases the load on the cache database and should therefore
-not be run frequently. This feature requires that the cache database
+<p> The amount of time between <a href="verify.8.html">verify(8)</a> address verification
+database cleanup runs. This feature requires that the database
 supports the "delete" and "sequence" operators.  Specify a zero
-interval to disable cache cleanup. </p>
+interval to disable database cleanup. </p>
 
 <p> Time units: s (seconds), m (minutes), h (hours), d (days), w
 (weeks). </p>
@@ -169,30 +168,32 @@ This feature is available in Postfix 2.1 and later.
 </DD>
 
 <DT><b><a name="address_verify_map">address_verify_map</a>
-(default: empty)</b></DT><DD>
+(default: see "postconf -d" output)</b></DT><DD>
 
 <p>
-Optional lookup table for persistent address verification status
+Lookup table for persistent address verification status
 storage.  The table is maintained by the <a href="verify.8.html">verify(8)</a> service, and
 is opened before the process releases privileges.
 </p>
 
 <p>
-By default, the information is kept in volatile memory, and is lost
-after "<b>postfix reload</b>" or "<b>postfix stop</b>".
+The lookup table is persistent by default as of Postfix version
+2.7. Specify an empty table name to keep the information in volatile
+memory which is lost after "<b>postfix reload</b>" or "<b>postfix
+stop</b>" (this is default with earlier Postfix versions).
 </p>
 
 <p>
 Specify a location in a file system that will not fill up. If the
 database becomes corrupted, the world comes to an end. To recover
-delete the file and do "<b>postfix reload</b>".
+delete (NOT: truncate) the file and do "<b>postfix reload</b>".
 </p>
 
 <p> As of version 2.5, Postfix no longer uses root privileges when
-opening this file. The file should now be stored under the Postfix-owned
-<a href="postconf.5.html#data_directory">data_directory</a>. As a migration aid, an attempt to open the file
-under a non-Postfix directory is redirected to the Postfix-owned
-<a href="postconf.5.html#data_directory">data_directory</a>, and a warning is logged. </p>
+opening this file. The file must now be stored under a Postfix-owned
+directory such as the <a href="postconf.5.html#data_directory">data_directory</a>. As a migration aid, an attempt
+to open the file under a non-Postfix directory is redirected to the
+Postfix-owned <a href="postconf.5.html#data_directory">data_directory</a>, and a warning is logged. </p>
 
 <p>
 Examples:
index 7143c1cb025eded5b57b052d41ddb715a3a6d13a..60df931eebaa5c3ed5dedefc64ea50ff6b8e1444 100644 (file)
@@ -86,9 +86,9 @@ VERIFY(8)                                                            VERIFY(8)
        <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
 
 <b>CACHE CONTROLS</b>
-       <b><a href="postconf.5.html#address_verify_map">address_verify_map</a> (empty)</b>
-              Optional  lookup table for persistent address veri-
-              fication status storage.
+       <b><a href="postconf.5.html#address_verify_map">address_verify_map</a> (see 'postconf -d' output)</b>
+              Lookup  table  for  persistent address verification
+              status storage.
 
        <b><a href="postconf.5.html#address_verify_sender">address_verify_sender</a> ($<a href="postconf.5.html#double_bounce_sender">double_bounce_sender</a>)</b>
               The sender address to use in  address  verification
index 5064d787e57d55a39b8934bae85d001717403bb4..bff378fd7ae9726076266d45d5de5a8421d14a08 100644 (file)
@@ -236,21 +236,22 @@ VIRTUAL(8)                                                          VIRTUAL(8)
               the virtual message delivery transport.
 
        <b><a href="postconf.5.html#virtual_mailbox_limit">virtual_mailbox_limit</a> (51200000)</b>
-              The maximal size in bytes of an individual  mailbox
-              or maildir file, or zero (no limit).
+              The maximal size in bytes  of  an  individual  <a href="virtual.8.html"><b>vir-</b></a>
+              <a href="virtual.8.html"><b>tual</b>(8)</a>  mailbox  or  maildir  file,  or  zero  (no
+              limit).
 
 <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 <a href="postconf.5.html">main.cf</a> and
+              The default location of  the  Postfix  <a href="postconf.5.html">main.cf</a>  and
               <a href="master.5.html">master.cf</a> configuration files.
 
        <b><a href="postconf.5.html#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#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
-              The maximal number  of  digits  after  the  decimal
+              The  maximal  number  of  digits  after the decimal
               point when logging sub-second delay values.
 
        <b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
@@ -258,33 +259,33 @@ VIRTUAL(8)                                                          VIRTUAL(8)
               over an internal communication channel.
 
        <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  an incoming connection
+              The  maximum  amount  of  time that an idle Postfix
+              daemon process waits  for  an  incoming  connection
               before terminating voluntarily.
 
        <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
-              The maximal number of incoming connections  that  a
-              Postfix  daemon  process will service before termi-
+              The  maximal  number of incoming connections that a
+              Postfix daemon process will service  before  termi-
               nating voluntarily.
 
        <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
-              The process ID  of  a  Postfix  command  or  daemon
+              The  process  ID  of  a  Postfix  command or daemon
               process.
 
        <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#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>
-              The  mail  system  name  that  is  prepended to the
-              process name in syslog  records,  so  that  "smtpd"
+              The mail system  name  that  is  prepended  to  the
+              process  name  in  syslog  records, so that "smtpd"
               becomes, for example, "postfix/smtpd".
 
 <b>SEE ALSO</b>
@@ -297,20 +298,20 @@ VIRTUAL(8)                                                          VIRTUAL(8)
        <a href="VIRTUAL_README.html">VIRTUAL_README</a>, domain hosting howto
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>HISTORY</b>
-       This delivery agent was originally based  on  the  Postfix
-       local  delivery  agent.  Modifications mainly consisted of
-       removing code that either was not applicable or  that  was
-       not  safe  in this context: aliases, ~user/.forward files,
+       This  delivery  agent  was originally based on the Postfix
+       local delivery agent. Modifications  mainly  consisted  of
+       removing  code  that either was not applicable or that was
+       not safe in this context: aliases,  ~user/.forward  files,
        delivery to "|command" or to /file/name.
 
        The <b>Delivered-To:</b> message header appears in the <b>qmail</b> sys-
        tem by Daniel Bernstein.
 
-       The  <b>maildir</b>  structure  appears  in  the  <b>qmail</b> system by
+       The <b>maildir</b> structure  appears  in  the  <b>qmail</b>  system  by
        Daniel Bernstein.
 
 <b>AUTHOR(S)</b>
index 7e5f62d27250ab4298dfed0241579bcc6ec07f9a..d58f43a00df45a09d34288707bc5bc10f85271d2 100644 (file)
@@ -78,11 +78,10 @@ an \fBaccess\fR(5) map "reject" action.
 .PP
 Do not change this unless you have a complete understanding of RFC 2821.
 .SH address_verify_cache_cleanup_interval (default: 12h)
-The amount of time between \fBverify\fR(8) cache cleanup runs.  Cache
-cleanup increases the load on the cache database and should therefore
-not be run frequently. This feature requires that the cache database
+The amount of time between \fBverify\fR(8) address verification
+database cleanup runs. This feature requires that the database
 supports the "delete" and "sequence" operators.  Specify a zero
-interval to disable cache cleanup.
+interval to disable database cleanup.
 .PP
 Time units: s (seconds), m (minutes), h (hours), d (days), w
 (weeks).
@@ -98,23 +97,25 @@ Overrides the local_transport parameter setting for address
 verification probes.
 .PP
 This feature is available in Postfix 2.1 and later.
-.SH address_verify_map (default: empty)
-Optional lookup table for persistent address verification status
+.SH address_verify_map (default: see "postconf -d" output)
+Lookup table for persistent address verification status
 storage.  The table is maintained by the \fBverify\fR(8) service, and
 is opened before the process releases privileges.
 .PP
-By default, the information is kept in volatile memory, and is lost
-after "\fBpostfix reload\fR" or "\fBpostfix stop\fR".
+The lookup table is persistent by default as of Postfix version
+2.7. Specify an empty table name to keep the information in volatile
+memory which is lost after "\fBpostfix reload\fR" or "\fBpostfix
+stop\fR" (this is default with earlier Postfix versions).
 .PP
 Specify a location in a file system that will not fill up. If the
 database becomes corrupted, the world comes to an end. To recover
-delete the file and do "\fBpostfix reload\fR".
+delete (NOT: truncate) the file and do "\fBpostfix reload\fR".
 .PP
 As of version 2.5, Postfix no longer uses root privileges when
-opening this file. The file should now be stored under the Postfix-owned
-data_directory. As a migration aid, an attempt to open the file
-under a non-Postfix directory is redirected to the Postfix-owned
-data_directory, and a warning is logged.
+opening this file. The file must now be stored under a Postfix-owned
+directory such as the data_directory. As a migration aid, an attempt
+to open the file under a non-Postfix directory is redirected to the
+Postfix-owned data_directory, and a warning is logged.
 .PP
 Examples:
 .PP
index a73d8a6b61213399bf015cb1d38e302848c1a94e..e7d0b96e1b255eb112894e71d98b6fab36b2f303 100644 (file)
@@ -93,8 +93,8 @@ The text below provides only a parameter summary. See
 .nf
 .ad
 .fi
-.IP "\fBaddress_verify_map (empty)\fR"
-Optional lookup table for persistent address verification status
+.IP "\fBaddress_verify_map (see 'postconf -d' output)\fR"
+Lookup table for persistent address verification status
 storage.
 .IP "\fBaddress_verify_sender ($double_bounce_sender)\fR"
 The sender address to use in address verification probes; prior
index b82beef4d66f0da27e73d207de3dcac1e624cb33..809474d9adc4cd24b4f3645c449acc8e98a0191e 100644 (file)
@@ -245,8 +245,8 @@ via the virtual message delivery transport.
 The maximal number of recipients per message for the virtual
 message delivery transport.
 .IP "\fBvirtual_mailbox_limit (51200000)\fR"
-The maximal size in bytes of an individual mailbox or maildir file,
-or zero (no limit).
+The maximal size in bytes of an individual \fBvirtual\fR(8) mailbox or
+maildir file, or zero (no limit).
 .SH "MISCELLANEOUS CONTROLS"
 .na
 .nf
index 973e5095c45b2e61236ffd3796bb0963e029070c..4f8d55e3a0e17535b85fcd0c853fb7d6cbf97a08 100644 (file)
@@ -402,40 +402,37 @@ sender address verification probe fails with some temporary error.
 
 <h2><a name="caching">Address verification database</a></h2>
 
-<p> NOTE: By default, address verification information is not stored
-in a persistent file. You have to specify one in main.cf (see
-below). Persistent storage is off by default because it may need
-more disk space than is available in your file system. </p>
-
-<p> Address verification information is cached by the Postfix verify
-daemon.  Postfix has a bunch of parameters that control the caching
-of positive and negative results. Refer to the verify(8) manual
-page for details. </p>
-
-<p> The address_verify_map (NOTE: singular) configuration parameter
-specifies an optional database for sender or recipient address
-verification results.  If you don't specify a file, all address
-verification information is lost after "postfix reload" or "postfix
-stop". </p>
-
-<p> If your /var file system has sufficient space, try: </p>
+<p> To improve performance, the Postfix verify(8) daemon can save
+address verification results to a persistent database.  The
+address_verify_map (NOTE: singular) configuration parameter specifies
+persistent storage for sender or recipient address verification
+results.  If you specify an empty value, all address verification
+results are lost after "postfix reload" or "postfix stop". </p>
 
 <blockquote>
 <pre>
 /etc/postfix/main.cf:
+    # Default setting for Postfix 2.7 and later.
     # Note: avoid hash files here. Use btree instead.
-    address_verify_map = btree:/var/lib/postfix/verify
+    address_verify_map = btree:$data_directory/verify_cache
+
+    # Default setting for Postfix 2.6 and earlier.
+    # This uses non-persistent storage only.
+    address_verify_map =
 </pre>
 </blockquote>
 
-<p> NOTE 1: As of version 2.5, Postfix no longer uses root privileges
-when opening this file. The file should now be stored under the
-Postfix-owned data_directory. As a migration aid, an attempt to
-open the file under a non-Postfix directory is redirected to the
-Postfix-owned data_directory, and a warning is logged. If you wish
-to continue using a pre-existing database file, move it to the
-data_directory, and change ownership to the account specified with
-the mail_owner parameter.  </p>
+<p> NOTE 1: The database file should be stored under a Postfix-owned
+directory, such as $data_directory. </p>
+
+<blockquote> As of version 2.5, Postfix no longer uses root privileges
+when opening this file. To maintain backwards compatibility, an
+attempt to open the file under a non-Postfix directory is redirected
+to the Postfix-owned data_directory, and a warning is logged. If
+you wish to continue using a pre-existing database file, change its
+file ownership to the account specified with the mail_owner parameter,
+and either move the file to the data_directory, or move it to some
+other Postfix-owned directory.  </blockquote>
 
 <p> NOTE 2: Do not put this file in a file system that may run out
 of space.  When the address verification table gets corrupted the
@@ -443,23 +440,28 @@ world comes to an end and YOU will have to MANUALLY fix things as
 described in the next section. Meanwhile, you will not receive mail
 via SMTP. </p>
 
-<p> NOTE 3: The verify(8) daemon process will create a new database when
-none exists, and will open/create the file before it enters the
+<p> NOTE 3: The verify(8) daemon will create a new database when
+none exists. It will open or create the file before entering the
 chroot jail. </p>
 
 <h2><a name="dirty_secret">Managing the address verification
 database</a></h2>
 
-<p> The verify(8) manual page describes parameters that control
-how long information remains cached before it needs to be refreshed,
-and how long information can remain "unrefreshed" before it expires.
-Postfix uses different controls for positive results (address was
-accepted) and for negative results (address was rejected). </p>
-
-<p> Right now, no tools are provided to manage the address verification
-database. If the file gets too big, or if it gets corrupted, you
-can manually rename or delete the file and run "postfix reload".
-The new verify daemon process will then create a new database. </p>
+<p> The verify(8) manual page describes parameters that control how
+long address verification results are cached before they need to
+be refreshed, and how long results can remain "unrefreshed" before
+they expire.  Postfix uses different controls for positive results
+(address was accepted) and for negative results (address was rejected,
+or address verification failed for some other reason). </p>
+
+<p> Current Postfix versions will periodically remove expired entries
+from the address verification database. With Postfix version 2.6
+and earlier, database cleanup had to be done as described next. </p>
+
+<p> If the address verification database file becomes too big, or
+if it becomes corrupted, the solution is to manually rename or
+delete (NOT: truncate) the file and run "postfix reload".  The
+verify(8) daemon will then create a new database file.  </p>
 
 <h2><a name="probe_routing">Controlling the routing of address
 verification probes</a></h2>
index 46070e5d95e8e951ac4100e5ad3137314e1cfc1f..716fbc5c15795d9d0969e596bfda900ed94d418d 100644 (file)
@@ -199,30 +199,32 @@ verification probes.
 This feature is available in Postfix 2.1 and later.
 </p>
 
-%PARAM address_verify_map
+%PARAM address_verify_map see "postconf -d" output
 
 <p>
-Optional lookup table for persistent address verification status
+Lookup table for persistent address verification status
 storage.  The table is maintained by the verify(8) service, and
 is opened before the process releases privileges.
 </p>
 
 <p>
-By default, the information is kept in volatile memory, and is lost
-after "<b>postfix reload</b>" or "<b>postfix stop</b>".
+The lookup table is persistent by default as of Postfix version
+2.7. Specify an empty table name to keep the information in volatile
+memory which is lost after "<b>postfix reload</b>" or "<b>postfix
+stop</b>" (this is default with earlier Postfix versions).
 </p>
 
 <p>
 Specify a location in a file system that will not fill up. If the
 database becomes corrupted, the world comes to an end. To recover
-delete the file and do "<b>postfix reload</b>".
+delete (NOT: truncate) the file and do "<b>postfix reload</b>".
 </p>
+
 <p> As of version 2.5, Postfix no longer uses root privileges when
-opening this file. The file should now be stored under the Postfix-owned
-data_directory. As a migration aid, an attempt to open the file
-under a non-Postfix directory is redirected to the Postfix-owned
-data_directory, and a warning is logged. </p>
+opening this file. The file must now be stored under a Postfix-owned
+directory such as the data_directory. As a migration aid, an attempt
+to open the file under a non-Postfix directory is redirected to the
+Postfix-owned data_directory, and a warning is logged. </p>
 
 <p>
 Examples:
@@ -282,11 +284,10 @@ This feature is available in Postfix 2.1 and later.
 
 %PARAM address_verify_cache_cleanup_interval 12h
 
-<p> The amount of time between verify(8) cache cleanup runs.  Cache
-cleanup increases the load on the cache database and should therefore
-not be run frequently. This feature requires that the cache database
+<p> The amount of time between verify(8) address verification
+database cleanup runs. This feature requires that the database
 supports the "delete" and "sequence" operators.  Specify a zero
-interval to disable cache cleanup. </p>
+interval to disable database cleanup. </p>
 
 <p> Time units: s (seconds), m (minutes), h (hours), d (days), w
 (weeks). </p>
index ef6c78c8cfb9137ed3daab70dd5f0e79f42237f0..5e5a8d5e2c41235a9ea43a3edaaf661d65555b81 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      "20100101"
+#define MAIL_RELEASE_DATE      "20100102"
 #define MAIL_VERSION_NUMBER    "2.7"
 
 #ifdef SNAPSHOT
index 4a808884052477c58c087529d15a0c5859b4e7c6..653919c854f09b47af6aa505b658353def8a354b 100644 (file)
@@ -498,6 +498,12 @@ dict_cidr_test: dict_open dict_cidr.in dict_cidr.map dict_cidr.ref
        diff dict_cidr.ref dict_cidr.tmp
        rm -f dict_cidr.tmp
 
+dict_seq_test: dict_open testdb dict_seq.in dict_seq.ref
+       rm -f testdb.db testdb.dir testdb.pag
+       ./dict_open hash:testdb create sync < dict_seq.in > dict_seq.tmp 2>&1
+       diff dict_seq.ref dict_seq.tmp
+       rm -f testdb.db testdb.dir testdb.pag dict_seq.tmp
+
 host_port_test: host_port host_port.in host_port.ref
        ./host_port <host_port.in >host_port.tmp 2>&1
        diff host_port.ref host_port.tmp
index d58e3f4595a9c7ace19cb4d3c1499c07fe42c49c..e4b301d105f1013aa84e3abe0b2cec2fa6a5d9a3 100644 (file)
@@ -535,8 +535,19 @@ static void dict_db_close(DICT *dict)
 #endif
     if (DICT_DB_SYNC(dict_db->db, 0) < 0)
        msg_fatal("flush database %s: %m", dict_db->dict.name);
+
+    /*
+     * With some Berkeley DB implementations, close fails with a bogus ENOENT
+     * error, while it reports no errors with put+sync, no errors with
+     * del+sync, and no errors with the sync operation just before this
+     * comment. This happens in programs that never fork and that never share
+     * the database with other processes. The bogus close error has been
+     * reported for programs that use the first/next iterator. Instead of
+     * making Postfix look bad because it reports errors that other programs
+     * ignore, I'm going to report the bogus error as a non-error.
+     */
     if (DICT_DB_CLOSE(dict_db->db) < 0)
-       msg_fatal("close database %s: %m", dict_db->dict.name);
+       msg_info("close database %s: %m", dict_db->dict.name);
     if (dict_db->key_buf)
        vstring_free(dict_db->key_buf);
     if (dict_db->val_buf)
index 700eaee35e6a9b43949ab930eb6b124aa9978179..04df52b6533e2ba57c2253a0e1c322f74a1495fa 100644 (file)
@@ -387,7 +387,7 @@ ARGV   *dict_mapnames()
 
 static NORETURN usage(char *myname)
 {
-    msg_fatal("usage: %s type:file read|write|create [fold]", myname);
+    msg_fatal("usage: %s type:file read|write|create [fold] [sync]", myname);
 }
 
 int     main(int argc, char **argv)
@@ -403,6 +403,7 @@ int     main(int argc, char **argv)
     const char *value;
     int     ch;
     int     dict_flags = DICT_FLAG_LOCK | DICT_FLAG_DUP_REPLACE;
+    int     n;
 
     signal(SIGPIPE, SIG_IGN);
 
@@ -417,7 +418,7 @@ int     main(int argc, char **argv)
        }
     }
     optind = OPTIND;
-    if (argc - optind < 2 || argc - optind > 3)
+    if (argc - optind < 2)
        usage(argv[0]);
     if (strcasecmp(argv[optind + 1], "create") == 0)
        open_flags = O_CREAT | O_RDWR | O_TRUNC;
@@ -427,8 +428,14 @@ int     main(int argc, char **argv)
        open_flags = O_RDONLY;
     else
        msg_fatal("unknown access mode: %s", argv[2]);
-    if (argv[optind + 2] && strcasecmp(argv[optind + 2], "fold") == 0)
-       dict_flags |= DICT_FLAG_FOLD_ANY;
+    for (n = 2; argv[optind + n]; n++) {
+       if (strcasecmp(argv[optind + 2], "fold") == 0)
+           dict_flags |= DICT_FLAG_FOLD_ANY;
+       else if (strcasecmp(argv[optind + 2], "sync") == 0)
+           dict_flags |= DICT_FLAG_SYNC_UPDATE;
+       else
+           usage(argv[0]);
+    }
     dict_name = argv[optind];
     dict = dict_open(dict_name, open_flags, dict_flags);
     dict_register(dict_name, dict);
diff --git a/postfix/src/util/dict_seq.in b/postfix/src/util/dict_seq.in
new file mode 100644 (file)
index 0000000..998e7c4
--- /dev/null
@@ -0,0 +1,11 @@
+put 5 5
+put 3 3
+put 4 4
+put 1 1
+put 2 2
+first
+next
+next
+next
+next
+next
diff --git a/postfix/src/util/dict_seq.ref b/postfix/src/util/dict_seq.ref
new file mode 100644 (file)
index 0000000..ce7d744
--- /dev/null
@@ -0,0 +1,22 @@
+> put 5 5
+5=5
+> put 3 3
+3=3
+> put 4 4
+4=4
+> put 1 1
+1=1
+> put 2 2
+2=2
+> first
+4=4
+> next
+2=2
+> next
+5=5
+> next
+3=3
+> next
+1=1
+> next
+not found
index 43be02e272053c260dbdd2b965468846d73215bf..b716ca48e9cef0fb49d99ffc154856c005944779 100644 (file)
@@ -77,8 +77,8 @@
 /* CACHE CONTROLS
 /* .ad
 /* .fi
-/* .IP "\fBaddress_verify_map (empty)\fR"
-/*     Optional lookup table for persistent address verification status
+/* .IP "\fBaddress_verify_map (see 'postconf -d' output)\fR"
+/*     Lookup table for persistent address verification status
 /*     storage.
 /* .IP "\fBaddress_verify_sender ($double_bounce_sender)\fR"
 /*     The sender address to use in address verification probes; prior
index 80d3bcf8c2e2d2e6b126a989fc33a5756df76e2d..599be61c98040039f015e375b27d682f53e297a6 100644 (file)
 /*     The maximal number of recipients per message for the virtual
 /*     message delivery transport.
 /* .IP "\fBvirtual_mailbox_limit (51200000)\fR"
-/*     The maximal size in bytes of an individual mailbox or maildir file,
-/*     or zero (no limit).
+/*     The maximal size in bytes of an individual \fBvirtual\fR(8) mailbox or
+/*     maildir file, or zero (no limit).
 /* MISCELLANEOUS CONTROLS
 /* .ad
 /* .fi