Next: , Previous: , Up: Top   [Contents][Index]


Appendix A Example: Using smapd with MeTA1

In this appendix we will show how to use the ‘mysql’ module (see mysql module) to configure local user and alias maps for MeTA1. For this purpose, we will assume that the actual data is stored in two tables in a MySQL database. The two maps will be served by two separate databases, each of which uses a separate configuration file.

To reduce the number of connections to the MySQL server, the MySQL database will be opened at the module level and shared between the two smap databases. Thus, the module initialization in smapd.conf looks like:

module mysql mysql config-group=smap

The ‘config-group’ parameter refers to a group name in the default /etc/my.cnf file that contains information about the MySQL database and credentials for accessing it. The following is a sample snippet from /etc/my.cnf:

[smap]
database   = Mail
user       = smap
password   = guessme
socket     = /tmp/mysql.sock