This module allows authentication information to be stored in a MySQL database.
When authmysql
is installed, a default configuration file,
authmysqlrc
will be installed too. You must edit this file to
set up your MySQL authentication.
NOTE: this authentication module should NOT be used if you are using the
vpopmail virtual mailing list manager. You should select the
authvchkpw
authentication module instead (which should happen
automatically). It may be necessary to use the
--without-authmysql
flag to the configure
script,
because configure
by default will include authmysql
if it finds MySQL client libraries..
Edit authmysqlrc
, and initialize the following variables:
MYSQL_SERVER
- MySQL server name (required).MYSQL_USERNAME
- MySQL username with log in with
(required).MYSQL_PASSWORD
- MySQL password with log in with
(required).MYSQL_DATABASE
- MySQL database to log in to
(required).MYSQL_USER_TABLE
- name of the MySQL with the
authentication information (see below) (required).MYSQL_CRYPT_PWFIELD
- name of the field containing the
crypt-ed password (either MYSQL_CRYPT_PWFIELD
or
MYSQL_CLEAR_PWFIELD
is required). NOTE: this password must
be crypt-ed using the operating system's crypt function, NOT MySQL's crypt
function. MySQL's crypt() function is non-standard and is not generally
compatible with the operating system's crypt function.MYSQL_CLEAR_PWFIELD
- name of the field containing the
cleartext password (either MYSQL_CRYPT_PWFIELD
or
MYSQL_CLEAR_PWFIELD
is required).MYSQL_MAILDIR_FIELD
- name of the field containing a
non-default location of the account's system mailbox (optional).DEFAULT_DOMAIN
- if the user logs in without specifying
@domain
, use the following domain (in this case the id field
must always contain user@host
) (optional).The table specified by MYSQL_USER_TABLE
should look as follows
(recommended):
CREATE TABLE passwd ( id char(128) DEFAULT '' NOT NULL, crypt char(128) DEFAULT '' NOT NULL, clear char(128) DEFAULT '' NOT NULL, uid int(10) unsigned DEFAULT '65534' NOT NULL, gid int(10) unsigned DEFAULT '65534' NOT NULL, home char(255) DEFAULT '' NOT NULL, maildir char(255) DEFAULT '' NOT NULL, KEY id (id(128)) );