Postfix map files provide an easy and efficient mechanism for the many lookup operations needed when handling email. In some situations, however, it can be more convenient to have the information in a database separate from Postfix. A database can provide a central repository available to many system or network services that need similar information, such as account names and passwords. A database can be useful when redundant systems running Postfix need to share the same configuration information. A central database might also be more convenient when you have multiple people who need access to edit information.
Databases can also slow Postfix performance compared to normal index files. In general, if you don't have a definite need for a database, you're better off with the standard Postfix maps. In many cases you can get the best of both options by storing information in a database and running regular scripts that update your Postfix files from the central data repository. But if your environment requires instant access to revised data, an external database configuration may be your only option.
In this chapter, we'll look at configuring Postfix to work with
MySQL and LDAP. (Postfix also has support for PostgreSQL as of Version
2.1.) In either case, Postfix must be compiled with additional libraries
to support the
ldap map types. If you are using a prebuilt package, make sure that it has support for the type of database you plan to use. If ...