diff --git a/postfix/.indent.pro b/postfix/.indent.pro index 42fe93c4d..f84368058 100644 --- a/postfix/.indent.pro +++ b/postfix/.indent.pro @@ -32,6 +32,8 @@ -TDELIVER_ATTR -TDELIVER_REQUEST -TDICT +-TDICT_CDBM +-TDICT_CDBQ -TDICT_CIDR -TDICT_CIDR_ENTRY -TDICT_DB diff --git a/postfix/HISTORY b/postfix/HISTORY index 5b207bc8e..45fbc2d84 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -9889,6 +9889,11 @@ Apologies for any names omitted. client sends a message header instead of an SMTP command. Magnus Baeck. File: smtpd/smtpd.c. +20041207 + + CDB support by Michael Tokarev, documentation by Victor + Duchovni. Files: util/dict_cdb.[hc], global/mkmap_cdb.c. + Open problems: Med: implement ${name[?:]value} in main.cf or update the diff --git a/postfix/README_FILES/AAAREADME b/postfix/README_FILES/AAAREADME index 19cc9a485..1496a490d 100644 --- a/postfix/README_FILES/AAAREADME +++ b/postfix/README_FILES/AAAREADME @@ -38,6 +38,7 @@ LLooookkuupp ttaabblleess ((ddaattaabbaasseess)) * DATABASE_README: Lookup table overview * DB_README: Berkeley DB Howto + * CDB_README: CDB Howto * LDAP_README: LDAP Howto * MYSQL_README: MySQL Howto * PCRE_README: PCRE Howto diff --git a/postfix/README_FILES/CDB_README b/postfix/README_FILES/CDB_README new file mode 100644 index 000000000..7d0e36b12 --- /dev/null +++ b/postfix/README_FILES/CDB_README @@ -0,0 +1,58 @@ +PPoossttffiixx CCDDBB HHoowwttoo + +------------------------------------------------------------------------------- + +IInnttrroodduuccttiioonn + +CDB (Constant DataBase) is an indexed file format designed by Daniel Bernstein. +CDB is optimized exclusively for read access and guarantees that each record +will be read in at most two disk accesses. This is achieved by forgoing support +for incremental updates: no single-record inserts or deletes are supported. CDB +databases can be modified only by rebuilding them completely from scratch, +hence the "constant" qualifier in the name. + +Postfix CDB databases are specified as "cdb:name", where name specifies the CDB +file name without the ".cdb" suffix (another suffix, ".tmp", is used +temporarily while a CDB file is under construction). CDB databases are +maintained with the postmap(1) or postalias(1) command. The DATABASE_README +document has general information about Postfix databases. + +CDB support is available with Postfix 2.2 and later releases. This document +describes how to build Postfix with CDB support. + +BBuuiillddiinngg PPoossttffiixx wwiitthh CCDDBB + +Postfix is compatible with two CDB implementations: + + * The original cdb library from Daniel Bernstein, available from http:// + cr.yp.to/cdb.html, and + + * tinycdb (version 0.5 and later) from Michael Tokarev, available from http:/ + /www.corpit.ru/mjt/tinycdb.html. + +Tinycdb is preferred, since it is a bit faster, has additional useful +functionality and is much simpler to use. + +To build Postfix after you have installed CDB, use something like: + + % make tidy + % CDB=../../../tinycdb-0.5 + % make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \ + "AUXLIBS=$CDB/libcdb.a" + % make + + for tinycdb, or alternatively, for the D.J.B. version: + + % make tidy + % CDB=../../../cdb-0.75 + % make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \ + "AUXLIBS=$CDB/cdb.a $CDB/alloc.a $CDB/buffer.a $CDB/unix.a $CDB/byte.a" + % make + +After postfix has been built with cdb support, you can use "cdb" tables +wherever you can use read-only "hash", "btree" or "dbm" tables. However, the +"ppoossttmmaapp --ii" (incremental record insertion) and "ppoossttmmaapp --dd" (incremental +record deletion) command-line options are not available. For the same reason +the "cdb" map type cannot be used to store the volatile address verification +cache for the verify(8) service. + diff --git a/postfix/README_FILES/DATABASE_README b/postfix/README_FILES/DATABASE_README index 5d1fb8b9c..a18c87989 100644 --- a/postfix/README_FILES/DATABASE_README +++ b/postfix/README_FILES/DATABASE_README @@ -123,7 +123,8 @@ Berkeley DB or other local database files, you still have a problem when the update fails because the disk is full or because something else happens. This is because commands such as postmap(1) or postalias(1) overwrite existing files. If the update fails in the middle then you have no usable database, and -Postfix will stop working. +Postfix will stop working. This is not an issue with the CDB database type +available with Postfix 2.2 and later, because CDB database rebuilds are atomic. With multi-file databases such as DBM, there is no simple solution. With Berkeley DB and other "one file" databases, it is possible to add some extra @@ -169,14 +170,20 @@ Postfix will keep using the existing database file as if nothing happened. PPoossttffiixx llooookkuupp ttaabbllee ttyyppeess -To find out what database types your Postfix system supports, use the "postconf --m" command. Here is a list of database types that are often supported: +To find out what database types your Postfix system supports, use the "ppoossttccoonnff +--mm" command. Here is a list of database types that are often supported: bbttrreeee A sorted, balanced tree structure. This is available only on systems with support for Berkeley DB databases. Database files are created with the postmap(1) or postalias(1) command. The lookup table name as used in "btree:table" is the database file name without the ".db" suffix. + ccddbb + A read-optimized structure with no support for incremental updates. + Database files are created with the postmap(1) or postalias(1) command. + The lookup table name as used in "cdb:table" is the database file name + without the ".cdb" suffix. This feature is available with Postfix 2.2 + and later. cciiddrr A table that associates values with Classless Inter-Domain Routing (CIDR) patterns. The table format is described in cidr_table(5). diff --git a/postfix/README_FILES/STANDARD_CONFIGURATION_README b/postfix/README_FILES/STANDARD_CONFIGURATION_README index cdb343426..b1ca2920e 100644 --- a/postfix/README_FILES/STANDARD_CONFIGURATION_README +++ b/postfix/README_FILES/STANDARD_CONFIGURATION_README @@ -33,7 +33,7 @@ Postfix should work out of the box without change on a stand-alone machine that has direct Internet access. At least, that is how Postfix installs when you download the Postfix source code via http://www.postfix.org/. -You can use the command "postconf -n" to find out what settings are overruled +You can use the command "ppoossttccoonnff --nn" to find out what settings are overruled by your main.cf. Besides a few pathname settings, few parameters should be set on a stand-alone box, beyond what is covered in the BASIC_CONFIGURATION_README document: @@ -174,9 +174,9 @@ to her preferred machine: jane: jane@janes.preferred.machine On some systems the alias database is not in /etc/aliases. To find out the -location for your system, execute the command "postconf alias_maps". +location for your system, execute the command "ppoossttccoonnff aalliiaass__mmaappss". -Execute the command "newaliases" whenever you change the aliases file. +Execute the command "nneewwaalliiaasseess" whenever you change the aliases file. PPoossttffiixx eemmaaiill ffiirreewwaallll//ggaatteewwaayy @@ -187,7 +187,7 @@ example.com", the firewall normally also accepts mail for "anything.example.com". That would not be right. Note: this example requires Postfix version 2.0 and later. To find out what -Postfix version you have, execute the command "postconf mail_version". +Postfix version you have, execute the command "ppoossttccoonnff mmaaiill__vveerrssiioonn". The solution is presented in multiple parts. This first part gets rid of local mail delivery on the firewall, making the firewall harder to break. @@ -268,13 +268,13 @@ Translation: * Lines 10, 17-18: Route mail for "example.com" to the inside gateway machine. The [] forces Postfix to do no MX lookup. -Specify dbm instead of hash if your system uses dbm files instead of db. To -find out what lookup tables Postfix supports, use the command "postconf -m". +Specify ddbbmm instead of hhaasshh if your system uses ddbbmm files instead of ddbb files. +To find out what lookup tables Postfix supports, use the command "ppoossttccoonnff --mm". -Execute the command "postmap /etc/postfix/relay_recipients" whenever you change +Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//rreellaayy__rreecciippiieennttss" whenever you change the relay_recipients table. -Execute the command "postmap /etc/postfix/transport" whenever you change the +Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//ttrraannssppoorrtt" whenever you change the transport table. DDeelliivveerriinngg ssoommee bbuutt nnoott aallll aaccccoouunnttss llooccaallllyy @@ -324,7 +324,7 @@ mail to the gateway host, and to send intranet mail directly. That's what Wietse does at work. Note: this example requires Postfix version 2.0 and later. To find out what -Postfix version you have, execute the command "postconf mail_version". +Postfix version you have, execute the command "ppoossttccoonnff mmaaiill__vveerrssiioonn". The following example presents additional configuration. You need to combine this with basic configuration information as discussed the first half of this @@ -356,10 +356,10 @@ Translation: is turned off. Postfix tries to deliver mail directly, and gives undeliverable mail to a gateway. -Specify dbm instead of hash if your system uses dbm files instead of db. To -find out what lookup tables Postfix supports, use the command "postconf -m". +Specify ddbbmm instead of hhaasshh if your system uses ddbbmm files instead of ddbb files. +To find out what lookup tables Postfix supports, use the command "ppoossttccoonnff --mm". -Execute the command "postmap /etc/postfix/transport" whenever you edit the +Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//ttrraannssppoorrtt" whenever you edit the transport table. CCoonnffiigguurriinngg PPoossttffiixx aass MMXX hhoosstt ffoorr aa rreemmoottee ssiittee @@ -418,10 +418,10 @@ Important notes: * Line 22: The [] forces Postfix to do no MX lookup. -Specify dbm instead of hash if your system uses dbm files instead of db files. -To find out what lookup tables Postfix supports, use the command "postconf -m". +Specify ddbbmm instead of hhaasshh if your system uses ddbbmm files instead of ddbb files. +To find out what lookup tables Postfix supports, use the command "ppoossttccoonnff --mm". -Execute the command "postmap /etc/postfix/transport" whenever you change the +Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//ttrraannssppoorrtt" whenever you change the transport table. PPoossttffiixx oonn aa ddiiaalluupp mmaacchhiinnee @@ -467,7 +467,7 @@ should also study the section on "Postfix on hosts without a real hostname". /usr/sbin/sendmail -q (whenever the Internet link is up) The exact location of the sendmail command is system-specific. Use the - command "postconf sendmail_path" to find out where the Postfix sendmail + command "ppoossttccoonnff sseennddmmaaiill__ppaatthh" to find out where the Postfix sendmail command is located on your machine. In order to find out if the mail queue is flushed, use something like: @@ -487,7 +487,7 @@ should also study the section on "Postfix on hosts without a real hostname". done If you have disabled spontaneous SMTP mail delivery, you also need to run - the "sendmail -q" command every now and then while the dialup link is up, + the "sseennddmmaaiill --qq" command every now and then while the dialup link is up, so that newly-posted mail is flushed from the queue. PPoossttffiixx oonn hhoossttss wwiitthhoouutt aa rreeaall hhoossttnnaammee diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 784c0de8a..0c6b2bf41 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -7,6 +7,13 @@ snapshot release). Patches are issued for the official release and change the patchlevel and the release date. Patches are never issued for snapshot releases. +Major changes with snapshot Postfix-2.2-20041208 +================================================ + +Support for CDB databases by Michael Tokarev. This supports both +Michael's tinycdb and Daniel Bernstein's cdb implementations, but +neither of the two implementations is bundled with Postfix. + Incompatible changes with snapshot Postfix-2.2-20041118 ======================================================= diff --git a/postfix/conf/access b/postfix/conf/access index f8569dc7c..dd10ffd97 100644 --- a/postfix/conf/access +++ b/postfix/conf/access @@ -23,7 +23,7 @@ # that serves as input to the postmap(1) command. The # result, an indexed file in dbm or db format, is used for # fast searching by the mail system. Execute the command -# postmap /etc/postfix/access in order to rebuild the +# "postmap /etc/postfix/access" in order to rebuild the # indexed file after changing the access table. # # When the table is provided via other means such as NIS, @@ -286,8 +286,8 @@ # The following example uses an indexed file, so that the # order of table entries does not matter. The example per- # mits access by the client at address 1.2.3.4 but rejects -# all other clients in 1.2.3.0/24. Instead of "hash" lookup -# tables, some systems use "dbm". Use the command "postconf +# all other clients in 1.2.3.0/24. Instead of hash lookup +# tables, some systems use dbm. Use the command "postconf # -m" to find out what lookup tables Postfix supports on # your system. # diff --git a/postfix/html/CDB_README.html b/postfix/html/CDB_README.html new file mode 100644 index 000000000..4506251d9 --- /dev/null +++ b/postfix/html/CDB_README.html @@ -0,0 +1,84 @@ + + + + +
+ +CDB (Constant DataBase) is an indexed file format designed by +Daniel Bernstein. CDB is optimized exclusively for read access +and guarantees that each record will be read in at most two disk +accesses. This is achieved by forgoing support for incremental +updates: no single-record inserts or deletes are supported. CDB +databases can be modified only by rebuilding them completely from +scratch, hence the "constant" qualifier in the name.
+ +Postfix CDB databases are specified as "cdb:name", where +name specifies the CDB file name without the ".cdb" suffix +(another suffix, ".tmp", is used temporarily while a CDB file is +under construction). CDB databases are maintained with the postmap(1) +or postalias(1) command. The DATABASE_README document has general +information about Postfix databases.
+ +CDB support is available with Postfix 2.2 and later releases. +This document describes how to build Postfix with CDB support.
+ +Postfix is compatible with two CDB implementations:
+ +The original cdb library from Daniel Bernstein, available +from http://cr.yp.to/cdb.html, and
+ +tinycdb (version 0.5 and later) from Michael Tokarev, +available from http://www.corpit.ru/mjt/tinycdb.html.
+ +Tinycdb is preferred, since it is a bit faster, has additional +useful functionality and is much simpler to use.
+ +To build Postfix after you have installed CDB, use something +like:
+ +++ ++% make tidy +% CDB=../../../tinycdb-0.5 +% make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \ + "AUXLIBS=$CDB/libcdb.a" +% make ++for tinycdb, or alternatively, for the D.J.B. version:
++% make tidy +% CDB=../../../cdb-0.75 +% make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \ + "AUXLIBS=$CDB/cdb.a $CDB/alloc.a $CDB/buffer.a $CDB/unix.a $CDB/byte.a" +% make ++
After postfix has been built with cdb support, you can use +"cdb" tables wherever you can use read-only "hash", "btree" or +"dbm" tables. However, the "postmap -i" (incremental record +insertion) and "postmap -d" (incremental record deletion) +command-line options are not available. For the same reason the +"cdb" map type cannot be used to store the volatile address +verification cache for the verify(8) service.
diff --git a/postfix/html/DATABASE_README.html b/postfix/html/DATABASE_README.html index 09f93d7e7..42dbdabd1 100644 --- a/postfix/html/DATABASE_README.html +++ b/postfix/html/DATABASE_README.html @@ -188,7 +188,9 @@ have a problem when the update fails because the disk is full or because something else happens. This is because commands such as postmap(1) or postalias(1) overwrite existing files. If the update fails in the middle then you have no usable database, and Postfix -will stop working. +will stop working. This is not an issue with the CDB database type +available with Postfix 2.2 and later, because CDB +database rebuilds are atomic.With multi-file databases such as DBM, there is no simple solution. With Berkeley DB and other "one file" databases, it is @@ -244,7 +246,7 @@ database file as if nothing happened.
To find out what database types your Postfix system supports, -use the "postconf -m" command. Here is a list of database types +use the "postconf -m" command. Here is a list of database types that are often supported:
@@ -259,6 +261,14 @@ created with the postmap(1) or +-cdb + +A read-optimized structure with no support for incremental updates. +Database files are created with the postmap(1) or postalias(1) command. +The lookup table name as used in "cdb:table" is the database file name +without the ".cdb" suffix. This feature is available with Postfix 2.2 +and later. +cidr A table that associates values with Classless Inter-Domain diff --git a/postfix/html/RESTRICTION_CLASS_README.html b/postfix/html/RESTRICTION_CLASS_README.html index 836ca79c8..857ef431c 100644 --- a/postfix/html/RESTRICTION_CLASS_README.html +++ b/postfix/html/RESTRICTION_CLASS_README.html @@ -110,7 +110,7 @@ to IP spoofing.
Specify dbm instead of hash if your system uses +
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command postconf -m.
@@ -209,7 +209,7 @@ with LDAP or SQL. -Specify dbm instead of hash if your system uses +
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command postconf -m.
diff --git a/postfix/html/STANDARD_CONFIGURATION_README.html b/postfix/html/STANDARD_CONFIGURATION_README.html index 2e100cd35..ac6caa60c 100644 --- a/postfix/html/STANDARD_CONFIGURATION_README.html +++ b/postfix/html/STANDARD_CONFIGURATION_README.html @@ -67,10 +67,10 @@ machine that has direct Internet access. At least, that is how Postfix installs when you download the Postfix source code via http://www.postfix.org/. -You can use the command "postconf -n" to find out what settings -are overruled by your main.cf. Besides a few pathname settings, -few parameters should be set on a stand-alone box, beyond what is -covered in the BASIC_CONFIGURATION_README document:
+You can use the command "postconf -n" to find out what +settings are overruled by your main.cf. Besides a few pathname +settings, few parameters should be set on a stand-alone box, beyond +what is covered in the BASIC_CONFIGURATION_README document:
@@ -253,11 +253,11 @@ forwards mail to her preferred machine:
On some systems the alias database is not in /etc/aliases. To -find out the location for your system, execute the command "postconf -alias_maps".
+find out the location for your system, execute the command "postconf +alias_maps". -Execute the command "newaliases" whenever you change the aliases -file.
+Execute the command "newaliases" whenever you change +the aliases file.
Note: this example requires Postfix version 2.0 and later. To find -out what Postfix version you have, execute the command "postconf -mail_version".
+out what Postfix version you have, execute the command "postconf +mail_version".The solution is presented in multiple parts. This first part gets rid of local mail delivery on the firewall, making the firewall @@ -381,14 +381,14 @@ gateway machine. The [] forces Postfix to do no MX lookup. -
Specify dbm instead of hash if your system uses -dbm files instead of db. To find out what lookup tables -Postfix supports, use the command "postconf -m".
+Specify dbm instead of hash if your system uses +dbm files instead of db files. To find out what lookup +tables Postfix supports, use the command "postconf -m".
-Execute the command "postmap /etc/postfix/relay_recipients" +
Execute the command "postmap /etc/postfix/relay_recipients" whenever you change the relay_recipients table.
-Execute the command "postmap /etc/postfix/transport" +
Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.
Note: this example requires Postfix version 2.0 and later. To find -out what Postfix version you have, execute the command "postconf -mail_version".
+out what Postfix version you have, execute the command "postconf +mail_version".The following example presents additional configuration. You need to combine this with basic configuration information as @@ -492,11 +492,11 @@ directly, and gives undeliverable mail to a gateway.
-Specify dbm instead of hash if your system uses dbm files -instead of db. To find out what lookup tables Postfix supports, use -the command "postconf -m".
+Specify dbm instead of hash if your system uses +dbm files instead of db files. To find out what lookup +tables Postfix supports, use the command "postconf -m".
-Execute the command "postmap /etc/postfix/transport" whenever +
Execute the command "postmap /etc/postfix/transport" whenever you edit the transport table.
Specify dbm instead of hash if your system uses dbm files -instead of db files. To find out what lookup tables Postfix supports, -use the command "postconf -m".
+Specify dbm instead of hash if your system uses +dbm files instead of db files. To find out what lookup +tables Postfix supports, use the command "postconf -m".
-Execute the command "postmap /etc/postfix/transport" whenever +
Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.
The exact location of the sendmail command is system-specific. -Use the command "postconf sendmail_path" to find out where the +Use the command "postconf sendmail_path" to find out where the Postfix sendmail command is located on your machine.
In order to find out if the mail queue is flushed, use something @@ -663,7 +663,7 @@ done
If you have disabled spontaneous -SMTP mail delivery, you also need to run the "sendmail -q" +SMTP mail delivery
, you also need to run the "sendmail -q" command every now and then while the dialup link is up, so that newly-posted mail is flushed from the queue. diff --git a/postfix/html/UUCP_README.html b/postfix/html/UUCP_README.html index 70dca6c9b..0a8a69d98 100644 --- a/postfix/html/UUCP_README.html +++ b/postfix/html/UUCP_README.html @@ -122,7 +122,7 @@ whenever you change the transport file. transport_maps = hash:/etc/postfix/transport -Specify dbm instead of hash if your system uses +
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command "postconf -m".
diff --git a/postfix/html/access.5.html b/postfix/html/access.5.html index 610397949..96e15a7f7 100644 --- a/postfix/html/access.5.html +++ b/postfix/html/access.5.html @@ -29,7 +29,7 @@ ACCESS(5) ACCESS(5) that serves as input to the postmap(1) command. The result, an indexed file in dbm or db format, is used for fast searching by the mail system. Execute the command - postmap /etc/postfix/access in order to rebuild the + "postmap /etc/postfix/access" in order to rebuild the indexed file after changing the access table. When the table is provided via other means such as NIS, @@ -292,8 +292,8 @@ ACCESS(5) ACCESS(5) The following example uses an indexed file, so that the order of table entries does not matter. The example per- mits access by the client at address 1.2.3.4 but rejects - all other clients in 1.2.3.0/24. Instead of "hash" lookup - tables, some systems use "dbm". Use the command "postconf + all other clients in 1.2.3.0/24. Instead of hash lookup + tables, some systems use dbm. Use the command "postconf -m" to find out what lookup tables Postfix supports on your system. diff --git a/postfix/html/index.html b/postfix/html/index.html index d371c2c78..61fe3ba8e 100644 --- a/postfix/html/index.html +++ b/postfix/html/index.html @@ -109,6 +109,8 @@ Per-client/user/etc. accessCDB (Constant DataBase) is an indexed file format designed by +Daniel Bernstein. CDB is optimized exclusively for read access +and guarantees that each record will be read in at most two disk +accesses. This is achieved by forgoing support for incremental +updates: no single-record inserts or deletes are supported. CDB +databases can be modified only by rebuilding them completely from +scratch, hence the "constant" qualifier in the name.
+ +Postfix CDB databases are specified as "cdb:name", where +name specifies the CDB file name without the ".cdb" suffix +(another suffix, ".tmp", is used temporarily while a CDB file is +under construction). CDB databases are maintained with the postmap(1) +or postalias(1) command. The DATABASE_README document has general +information about Postfix databases.
+ +CDB support is available with Postfix 2.2 and later releases. +This document describes how to build Postfix with CDB support.
+ +Postfix is compatible with two CDB implementations:
+ +The original cdb library from Daniel Bernstein, available +from http://cr.yp.to/cdb.html, and
+ +tinycdb (version 0.5 and later) from Michael Tokarev, +available from http://www.corpit.ru/mjt/tinycdb.html.
+ +Tinycdb is preferred, since it is a bit faster, has additional +useful functionality and is much simpler to use.
+ +To build Postfix after you have installed CDB, use something +like:
+ +++ ++% make tidy +% CDB=../../../tinycdb-0.5 +% make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \ + "AUXLIBS=$CDB/libcdb.a" +% make ++for tinycdb, or alternatively, for the D.J.B. version:
++% make tidy +% CDB=../../../cdb-0.75 +% make -f Makefile.init makefiles "CCARGS=-DHAS_CDB -I$CDB" \ + "AUXLIBS=$CDB/cdb.a $CDB/alloc.a $CDB/buffer.a $CDB/unix.a $CDB/byte.a" +% make ++
After postfix has been built with cdb support, you can use +"cdb" tables wherever you can use read-only "hash", "btree" or +"dbm" tables. However, the "postmap -i" (incremental record +insertion) and "postmap -d" (incremental record deletion) +command-line options are not available. For the same reason the +"cdb" map type cannot be used to store the volatile address +verification cache for the verify(8) service.
diff --git a/postfix/proto/DATABASE_README.html b/postfix/proto/DATABASE_README.html index 5fbd1d8ce..d4a25751a 100644 --- a/postfix/proto/DATABASE_README.html +++ b/postfix/proto/DATABASE_README.html @@ -188,7 +188,9 @@ have a problem when the update fails because the disk is full or because something else happens. This is because commands such as postmap(1) or postalias(1) overwrite existing files. If the update fails in the middle then you have no usable database, and Postfix -will stop working. +will stop working. This is not an issue with the CDB database type +available with Postfix 2.2 and later, because CDB +database rebuilds are atomic.With multi-file databases such as DBM, there is no simple solution. With Berkeley DB and other "one file" databases, it is @@ -244,7 +246,7 @@ database file as if nothing happened.
To find out what database types your Postfix system supports, -use the "postconf -m" command. Here is a list of database types +use the "postconf -m" command. Here is a list of database types that are often supported:
@@ -259,6 +261,14 @@ created with the postmap(1) or postalias(1) command. The lookup table name as used in "btree:table" is the database file name without the ".db" suffix. +-cdb + +A read-optimized structure with no support for incremental updates. +Database files are created with the postmap(1) or postalias(1) command. +The lookup table name as used in "cdb:table" is the database file name +without the ".cdb" suffix. This feature is available with Postfix 2.2 +and later. +cidr A table that associates values with Classless Inter-Domain diff --git a/postfix/proto/Makefile.in b/postfix/proto/Makefile.in index 743dc83b0..2b8b84007 100644 --- a/postfix/proto/Makefile.in +++ b/postfix/proto/Makefile.in @@ -11,6 +11,7 @@ HTML = ../html/ADDRESS_CLASS_README.html \ ../html/BACKSCATTER_README.html \ ../html/BASIC_CONFIGURATION_README.html \ ../html/BUILTIN_FILTER_README.html \ + ../html/CDB_README.html \ ../html/CONTENT_INSPECTION_README.html \ ../html/CYRUS_README.html \ ../html/DATABASE_README.html ../html/DB_README.html \ @@ -41,6 +42,7 @@ README = ../README_FILES/ADDRESS_CLASS_README \ ../README_FILES/BACKSCATTER_README \ ../README_FILES/BASIC_CONFIGURATION_README \ ../README_FILES/BUILTIN_FILTER_README \ + ../README_FILES/CDB_README \ ../README_FILES/CONTENT_INSPECTION_README \ ../README_FILES/CYRUS_README \ ../README_FILES/DATABASE_README ../README_FILES/DB_README \ @@ -122,6 +124,9 @@ clobber: ../html/BACKSCATTER_README.html: BACKSCATTER_README.html $(POSTLINK) $? >$@ +../html/CDB_README.html: CDB_README.html + $(POSTLINK) $? >$@ + ../html/CONTENT_INSPECTION_README.html: CONTENT_INSPECTION_README.html $(POSTLINK) $? >$@ @@ -251,6 +256,9 @@ clobber: ../README_FILES/BUILTIN_FILTER_README: BUILTIN_FILTER_README.html $(HT2READ) $? >$@ +../README_FILES/CDB_README: CDB_README.html + $(HT2READ) $? >$@ + ../README_FILES/CONTENT_INSPECTION_README: CONTENT_INSPECTION_README.html $(HT2READ) $? >$@ diff --git a/postfix/proto/RESTRICTION_CLASS_README.html b/postfix/proto/RESTRICTION_CLASS_README.html index 7d9ad751f..3c5ca1825 100644 --- a/postfix/proto/RESTRICTION_CLASS_README.html +++ b/postfix/proto/RESTRICTION_CLASS_README.html @@ -110,7 +110,7 @@ to IP spoofing.
Specify dbm instead of hash if your system uses +
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command postconf -m.
@@ -209,7 +209,7 @@ with LDAP or SQL. -Specify dbm instead of hash if your system uses +
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command postconf -m.
diff --git a/postfix/proto/STANDARD_CONFIGURATION_README.html b/postfix/proto/STANDARD_CONFIGURATION_README.html index 5b0cbc341..c3999645e 100644 --- a/postfix/proto/STANDARD_CONFIGURATION_README.html +++ b/postfix/proto/STANDARD_CONFIGURATION_README.html @@ -67,10 +67,10 @@ machine that has direct Internet access. At least, that is how Postfix installs when you download the Postfix source code via http://www.postfix.org/. -You can use the command "postconf -n" to find out what settings -are overruled by your main.cf. Besides a few pathname settings, -few parameters should be set on a stand-alone box, beyond what is -covered in the BASIC_CONFIGURATION_README document:
+You can use the command "postconf -n" to find out what +settings are overruled by your main.cf. Besides a few pathname +settings, few parameters should be set on a stand-alone box, beyond +what is covered in the BASIC_CONFIGURATION_README document:
@@ -253,11 +253,11 @@ forwards mail to her preferred machine:
On some systems the alias database is not in /etc/aliases. To -find out the location for your system, execute the command "postconf -alias_maps".
+find out the location for your system, execute the command "postconf +alias_maps". -Execute the command "newaliases" whenever you change the aliases -file.
+Execute the command "newaliases" whenever you change +the aliases file.
Note: this example requires Postfix version 2.0 and later. To find -out what Postfix version you have, execute the command "postconf -mail_version".
+out what Postfix version you have, execute the command "postconf +mail_version".The solution is presented in multiple parts. This first part gets rid of local mail delivery on the firewall, making the firewall @@ -381,14 +381,14 @@ gateway machine. The [] forces Postfix to do no MX lookup. -
Specify dbm instead of hash if your system uses -dbm files instead of db. To find out what lookup tables -Postfix supports, use the command "postconf -m".
+Specify dbm instead of hash if your system uses +dbm files instead of db files. To find out what lookup +tables Postfix supports, use the command "postconf -m".
-Execute the command "postmap /etc/postfix/relay_recipients" +
Execute the command "postmap /etc/postfix/relay_recipients" whenever you change the relay_recipients table.
-Execute the command "postmap /etc/postfix/transport" +
Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.
Note: this example requires Postfix version 2.0 and later. To find -out what Postfix version you have, execute the command "postconf -mail_version".
+out what Postfix version you have, execute the command "postconf +mail_version".The following example presents additional configuration. You need to combine this with basic configuration information as @@ -492,11 +492,11 @@ directly, and gives undeliverable mail to a gateway.
-Specify dbm instead of hash if your system uses dbm files -instead of db. To find out what lookup tables Postfix supports, use -the command "postconf -m".
+Specify dbm instead of hash if your system uses +dbm files instead of db files. To find out what lookup +tables Postfix supports, use the command "postconf -m".
-Execute the command "postmap /etc/postfix/transport" whenever +
Execute the command "postmap /etc/postfix/transport" whenever you edit the transport table.
Specify dbm instead of hash if your system uses dbm files -instead of db files. To find out what lookup tables Postfix supports, -use the command "postconf -m".
+Specify dbm instead of hash if your system uses +dbm files instead of db files. To find out what lookup +tables Postfix supports, use the command "postconf -m".
-Execute the command "postmap /etc/postfix/transport" whenever +
Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.
The exact location of the sendmail command is system-specific. -Use the command "postconf sendmail_path" to find out where the +Use the command "postconf sendmail_path" to find out where the Postfix sendmail command is located on your machine.
In order to find out if the mail queue is flushed, use something @@ -663,7 +663,7 @@ done
If you have disabled spontaneous -SMTP mail delivery, you also need to run the "sendmail -q" +SMTP mail delivery
, you also need to run the "sendmail -q" command every now and then while the dialup link is up, so that newly-posted mail is flushed from the queue. diff --git a/postfix/proto/UUCP_README.html b/postfix/proto/UUCP_README.html index e4af2829a..c614ceeb3 100644 --- a/postfix/proto/UUCP_README.html +++ b/postfix/proto/UUCP_README.html @@ -122,7 +122,7 @@ whenever you change the transport file. transport_maps = hash:/etc/postfix/transport -Specify dbm instead of hash if your system uses +
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command "postconf -m".
diff --git a/postfix/proto/access b/postfix/proto/access index f5825882d..e4d3efb7a 100644 --- a/postfix/proto/access +++ b/postfix/proto/access @@ -22,7 +22,7 @@ # that serves as input to the \fBpostmap\fR(1) command. # The result, an indexed file in \fBdbm\fR or \fBdb\fR format, # is used for fast searching by the mail system. Execute the command -# \fBpostmap /etc/postfix/access\fR in order to rebuild the indexed +# "\fBpostmap /etc/postfix/access\fR" in order to rebuild the indexed # file after changing the access table. # # When the table is provided via other means such as NIS, LDAP @@ -249,8 +249,8 @@ # The following example uses an indexed file, so that the # order of table entries does not matter. The example permits # access by the client at address 1.2.3.4 but rejects all -# other clients in 1.2.3.0/24. Instead of "\fBhash\fR" lookup -# tables, some systems use "\fBdbm\fR". Use the command +# other clients in 1.2.3.0/24. Instead of \fBhash\fR lookup +# tables, some systems use \fBdbm\fR. Use the command # "\fBpostconf -m\fR" to find out what lookup tables Postfix # supports on your system. # diff --git a/postfix/proto/stop b/postfix/proto/stop index c5cf9688c..e7f75c98d 100644 --- a/postfix/proto/stop +++ b/postfix/proto/stop @@ -10,6 +10,7 @@ README RFC Sendmail's Wietse +cdb cf com db @@ -91,6 +92,7 @@ sysadmin userid username Autoreplies +CDB DBM Howto MAILDROP diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index 09305f61b..3d5dd511e 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -14,7 +14,7 @@ SRCS = abounce.c anvil_clnt.c been_here.c bounce.c bounce_log.c \ mail_open_ok.c mail_params.c mail_pathname.c mail_queue.c \ mail_run.c mail_scan_dir.c mail_stream.c mail_task.c mail_trigger.c \ maps.c mark_corrupt.c match_parent_style.c mbox_conf.c \ - mbox_open.c mime_state.c mkmap_db.c mkmap_dbm.c mkmap_open.c \ + mbox_open.c mime_state.c mkmap_db.c mkmap_cdb.c mkmap_dbm.c mkmap_open.c \ mynetworks.c mypwd.c namadr_list.c off_cvt.c opened.c \ own_inet_addr.c pipe_command.c post_mail.c quote_821_local.c \ quote_822_local.c rec_streamlf.c rec_type.c recipient_list.c \ @@ -39,7 +39,7 @@ OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \ mail_open_ok.o mail_params.o mail_pathname.o mail_queue.o \ mail_run.o mail_scan_dir.o mail_stream.o mail_task.o mail_trigger.o \ maps.o mark_corrupt.o match_parent_style.o mbox_conf.o \ - mbox_open.o mime_state.o mkmap_db.o mkmap_dbm.o mkmap_open.o \ + mbox_open.o mime_state.o mkmap_db.o mkmap_cdb.o mkmap_dbm.o mkmap_open.o \ mynetworks.o mypwd.o namadr_list.o off_cvt.o opened.o \ own_inet_addr.o pipe_command.o post_mail.o quote_821_local.o \ quote_822_local.o rec_streamlf.o rec_type.o recipient_list.o \ @@ -1031,6 +1031,8 @@ mime_state.o: mail_params.h mime_state.o: header_token.h mime_state.o: lex_822.h mime_state.o: mime_state.h +mkmap_cdb.o: mkmap_cdb.c +mkmap_cdb.o: ../../include/sys_defs.h mkmap_db.o: mkmap_db.c mkmap_db.o: ../../include/sys_defs.h mkmap_db.o: ../../include/msg.h @@ -1066,6 +1068,7 @@ mkmap_open.o: ../../include/vstream.h mkmap_open.o: ../../include/vbuf.h mkmap_open.o: ../../include/argv.h mkmap_open.o: ../../include/dict_db.h +mkmap_open.o: ../../include/dict_cdb.h mkmap_open.o: ../../include/dict_dbm.h mkmap_open.o: ../../include/sigdelay.h mkmap_open.o: ../../include/mymalloc.h diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 4386c6852..8572c42a9 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only. */ -#define MAIL_RELEASE_DATE "20041207" +#define MAIL_RELEASE_DATE "20041208" #define MAIL_VERSION_NUMBER "2.2" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/global/mkmap.h b/postfix/src/global/mkmap.h index fc23d64d5..848dbc003 100644 --- a/postfix/src/global/mkmap.h +++ b/postfix/src/global/mkmap.h @@ -36,6 +36,7 @@ extern void mkmap_close(MKMAP *); #define mkmap_append(map, key, val) dict_put((map)->dict, (key), (val)) extern MKMAP *mkmap_dbm_open(const char *); +extern MKMAP *mkmap_cdb_open(const char *); extern MKMAP *mkmap_hash_open(const char *); extern MKMAP *mkmap_btree_open(const char *); diff --git a/postfix/src/global/mkmap_cdb.c b/postfix/src/global/mkmap_cdb.c new file mode 100644 index 000000000..83bf96d37 --- /dev/null +++ b/postfix/src/global/mkmap_cdb.c @@ -0,0 +1,65 @@ +/*++ +/* NAME +/* mkmap_cdb 3 +/* SUMMARY +/* create or open database, CDB style +/* SYNOPSIS +/* #include