A.1 Configure local_user_map.

Let's configure ‘local_user_map’ first. User data will be stored in the table ‘userdb’, which has the following structure:

  user varchar(32) NOT NULL default '',
  mailbox text
  PRIMARY KEY (user)

The smap database is defined as follows:

database userdb mysql \
    query="SELECT user FROM userdb WHERE user='$key'"

The ‘defaultdb’ parameter tells it to use the default SQL database opened in the module initialization instruction. The ‘query’ parameter supplies the SQL query to run (the ‘${key}’ variable will be expanded to the value of the actual lookup key, prior to executing the query). Finally, ‘positive-reply’ defines the reply to give if the query returns some tuples. The database only verifies whether the user is present or not, so no additional result is supplied in the reply.