1 ##VERSION: $Id: authmysqlrc,v 1.20 2007/10/07 02:50:45 mrsam Exp $
3 # Copyright 2000-2007 Double Precision, Inc. See COPYING for
4 # distribution information.
6 # Do not alter lines that begin with ##, they are used when upgrading
9 # authmysqlrc created from authmysqlrc.dist by sysconftool
11 # DO NOT INSTALL THIS FILE with world read permissions. This file
12 # might contain the MySQL admin password!
14 # Each line in this file must follow the following format:
16 # field[spaces|tabs]value
18 # That is, the name of the field, followed by spaces or tabs, followed by
19 # field value. Trailing spaces are prohibited.
24 # The server name, userid, and password used to log in.
26 MYSQL_SERVER mysql.example.com
32 # The SSL information.
34 # To use SSL-encrypted connections, define the following variables (available
35 # in MySQL 4.0, or higher):
38 # MYSQL_SSL_KEY /path/to/file
39 # MYSQL_SSL_CERT /path/to/file
40 # MYSQL_SSL_CACERT /path/to/file
41 # MYSQL_SSL_CAPATH /path/to/file
42 # MYSQL_SSL_CIPHERS ALL:!DES
44 ##NAME: MYSQL_SOCKET:0
46 # MYSQL_SOCKET can be used with MySQL version 3.22 or later, it specifies the
47 # filesystem pipe used for the connection
49 # MYSQL_SOCKET /var/mysql/mysql.sock
53 # MYSQL_PORT can be used with MySQL version 3.22 or later to specify a port to
60 # Leave MYSQL_OPT as 0, unless you know what you're doing.
64 ##NAME: MYSQL_DATABASE:0
66 # The name of the MySQL database we will open:
70 #NAME: MYSQL_CHARACTER_SET:0
72 # This is optional. MYSQL_CHARACTER_SET installs a character set. This option
73 # can be used with MySQL version 4.1 or later. MySQL supports 70+ collations
74 # for 30+ character sets. See MySQL documentations for more detalis.
76 # MYSQL_CHARACTER_SET latin1
78 ##NAME: MYSQL_USER_TABLE:0
80 # The name of the table containing your user data. See README.authmysqlrc
81 # for the required fields in this table.
83 MYSQL_USER_TABLE passwd
85 ##NAME: MYSQL_CRYPT_PWFIELD:0
87 # Either MYSQL_CRYPT_PWFIELD or MYSQL_CLEAR_PWFIELD must be defined. Both
88 # are OK too. crypted passwords go into MYSQL_CRYPT_PWFIELD, cleartext
89 # passwords go into MYSQL_CLEAR_PWFIELD. Cleartext passwords allow
90 # CRAM-MD5 authentication to be implemented.
92 MYSQL_CRYPT_PWFIELD crypt
94 ##NAME: MYSQL_CLEAR_PWFIELD:0
97 # MYSQL_CLEAR_PWFIELD clear
99 ##NAME: MYSQL_DEFAULT_DOMAIN:0
101 # If DEFAULT_DOMAIN is defined, and someone tries to log in as 'user',
102 # we will look up 'user@DEFAULT_DOMAIN' instead.
105 # DEFAULT_DOMAIN example.com
107 ##NAME: MYSQL_UID_FIELD:0
109 # Other fields in the mysql table:
111 # MYSQL_UID_FIELD - contains the numerical userid of the account
115 ##NAME: MYSQL_GID_FIELD:0
117 # Numerical groupid of the account
121 ##NAME: MYSQL_LOGIN_FIELD:0
123 # The login id, default is id. Basically the query is:
125 # SELECT MYSQL_UID_FIELD, MYSQL_GID_FIELD, ... WHERE id='loginid'
130 ##NAME: MYSQL_HOME_FIELD:0
133 MYSQL_HOME_FIELD home
135 ##NAME: MYSQL_NAME_FIELD:0
137 # The user's name (optional)
139 MYSQL_NAME_FIELD name
141 ##NAME: MYSQL_MAILDIR_FIELD:0
143 # This is an optional field, and can be used to specify an arbitrary
144 # location of the maildir for the account, which normally defaults to
145 # $HOME/Maildir (where $HOME is read from MYSQL_HOME_FIELD).
147 # You still need to provide a MYSQL_HOME_FIELD, even if you uncomment this
150 # MYSQL_MAILDIR_FIELD maildir
152 ##NAME: MYSQL_DEFAULTDELIVERY:0
154 # Courier mail server only: optional field specifies custom mail delivery
155 # instructions for this account (if defined) -- essentially overrides
156 # DEFAULTDELIVERY from ${sysconfdir}/courierd
158 # MYSQL_DEFAULTDELIVERY defaultdelivery
160 ##NAME: MYSQL_QUOTA_FIELD:0
162 # Define MYSQL_QUOTA_FIELD to be the name of the field that can optionally
163 # specify a maildir quota. See README.maildirquota for more information
165 # MYSQL_QUOTA_FIELD quota
167 ##NAME: MYSQL_AUXOPTIONS:0
169 # Auxiliary options. The MYSQL_AUXOPTIONS field should be a char field that
170 # contains a single string consisting of comma-separated "ATTRIBUTE=NAME"
171 # pairs. These names are additional attributes that define various per-account
172 # "options", as given in INSTALL's description of the "Account OPTIONS"
175 # MYSQL_AUXOPTIONS_FIELD auxoptions
177 # You might want to try something like this, if you'd like to use a bunch
178 # of individual fields, instead of a single text blob:
180 # MYSQL_AUXOPTIONS_FIELD CONCAT("disableimap=",disableimap,",disablepop3=",disablepop3,",disablewebmail=",disablewebmail,",sharedgroup=",sharedgroup)
182 # This will let you define fields called "disableimap", etc, with the end result
183 # being something that the OPTIONS parser understands.
186 ##NAME: MYSQL_WHERE_CLAUSE:0
188 # This is optional, MYSQL_WHERE_CLAUSE can be basically set to an arbitrary
189 # fixed string that is appended to the WHERE clause of our query
191 # MYSQL_WHERE_CLAUSE server='mailhost.example.com'
193 ##NAME: MYSQL_SELECT_CLAUSE:0
196 # This is optional, MYSQL_SELECT_CLAUSE can be set when you have a database,
197 # which is structuraly different from proposed. The fixed string will
198 # be used to do a SELECT operation on database, which should return fields
199 # in order specified bellow:
201 # username, cryptpw, clearpw, uid, gid, home, maildir, quota, fullname, options
203 # The username field should include the domain (see example below).
205 # Enabling this option causes ignorance of any other field-related
206 # options, excluding default domain.
208 # There are two variables, which you can use. Substitution will be made
209 # for them, so you can put entered username (local part) and domain name
210 # in the right place of your query. These variables are:
211 # $(local_part), $(domain), $(service)
213 # If a $(domain) is empty (not given by the remote user) the default domain
214 # name is used in its place.
216 # $(service) will expand out to the service being authenticated: imap, imaps,
217 # pop3 or pop3s. Courier mail server only: service will also expand out to
218 # "courier", when searching for local mail account's location. In this case,
219 # if the "maildir" field is not empty it will be used in place of
220 # DEFAULTDELIVERY. Courier mail server will also use esmtp when doing
221 # authenticated ESMTP.
223 # This example is a little bit modified adaptation of vmail-sql
226 # MYSQL_SELECT_CLAUSE SELECT CONCAT(popbox.local_part, '@', popbox.domain_name), \
227 # CONCAT('{MD5}', popbox.password_hash), \
231 # CONCAT(domain.path, '/', popbox.mbox_name), \
235 # CONCAT("disableimap=",disableimap,",disablepop3=", \
236 # disablepop3,",disablewebmail=",disablewebmail, \
237 # ",sharedgroup=",sharedgroup) \
238 # FROM popbox, domain \
239 # WHERE popbox.local_part = '$(local_part)' \
240 # AND popbox.domain_name = '$(domain)' \
241 # AND popbox.domain_name = domain.domain_name
244 ##NAME: MYSQL_ENUMERATE_CLAUSE:1
247 # Optional custom SQL query used to enumerate accounts for authenumerate,
248 # in order to compile a list of accounts for shared folders. The query
249 # should return the following fields: name, uid, gid, homedir, maildir, options
252 # MYSQL_ENUMERATE_CLAUSE SELECT CONCAT(popbox.local_part, '@', popbox.domain_name), \
255 # CONCAT(domain.path, '/', popbox.mbox_name), \
257 # CONCAT('sharedgroup=', sharedgroup) \
258 # FROM popbox, domain \
259 # WHERE popbox.local_part = '$(local_part)' \
260 # AND popbox.domain_name = '$(domain)' \
261 # AND popbox.domain_name = domain.domain_name
265 ##NAME: MYSQL_CHPASS_CLAUSE:0
268 # This is optional, MYSQL_CHPASS_CLAUSE can be set when you have a database,
269 # which is structuraly different from proposed. The fixed string will
270 # be used to do an UPDATE operation on database. In other words, it is
271 # used, when changing password.
273 # There are four variables, which you can use. Substitution will be made
274 # for them, so you can put entered username (local part) and domain name
275 # in the right place of your query. There variables are:
276 # $(local_part) , $(domain) , $(newpass) , $(newpass_crypt)
278 # If a $(domain) is empty (not given by the remote user) the default domain
279 # name is used in its place.
280 # $(newpass) contains plain password
281 # $(newpass_crypt) contains its crypted form
283 # MYSQL_CHPASS_CLAUSE UPDATE popbox \
284 # SET clearpw='$(newpass)', \
285 # password_hash='$(newpass_crypt)' \
286 # WHERE local_part='$(local_part)' \
287 # AND domain_name='$(domain)'