Next: , Previous: Radius Statement, Up: configuration   [Contents][Index]


3.2.16 SQL Statement

Editor’s note:

The information in this node may be obsolete or otherwise inaccurate. This message will disappear, once this node revised.

Syntax

sql {
  # Set SQL interface to use.
  interface ‘mysql|odbc|postgres’;
  # SQL server host name.
  host arg;
  # SQL user name.
  user arg;
  # Password for the SQL user.
  passwd arg;
  # SQL server port.
  port arg;
  # Database name.
  db arg;
  # Type of password returned by getpass query.
  password-type ‘plain | hash | scrambled’;
  # Set a field-map for parsing SQL replies.
  field-map map;
  # SQL query returning the user’s password.
  getpass query;
  # SQL query to use for getpwnam requests.
  getpwnam query;
  # SQL query to use for getpwuid requests.
  getpwuid query;
}

3.2.17 Description

The sql statement configures access credentials to SQL database and the queries for authentication and authorization.

GNU Mailutils supports three types of SQL interfaces: MySQL, PostgreSQL and ODBC. The latter is a standard API for using database management systems, which can be used to communicate with a wide variety of DBMS.

Configuration: interface type

Configures type of DBMS interface. Allowed values for type are:

mysql

Interface with a MySQL server (http://www.mysql.org).

odbc

Use ODBC interface. See http://www.unixodbc.org, for a detailed description of ODBC configuration.

postgres

Interface with a PostgreSQL server (http://www.postgres.org).

The database and database access credentials are configured using the following statements:

Configuration: host arg

The host running the SQL server. The value can be either a host name or an IP address in dotted-quad notation, in which case an INET connection is used, or a full pathname to a file, in which case a connection to UNIX socket is used.

Configuration: port arg

TCP port the server is listening on (for INET connections). This parameter is optional. Its default value depends on the type of database being used.

Configuration: db arg;

Name of the database.

Configuration: user arg

SQL user name.

Configuration: passwd arg;

Password to access the database.


Next: , Previous: Radius Statement, Up: configuration   [Contents][Index]