2 # Modify template in /etc/alternc/templates/
3 # and launch alternc.install if you want
7 # This file is opened as root, so it should be owned by root and mode 0600.
9 # http://wiki.dovecot.org/AuthDatabase/SQL
11 # For the sql passdb module, you'll need a database with a table that
12 # contains fields for at least the username and password. If you want to
13 # use the user@domain syntax, you might want to have a separate domain
16 # If your users all have the same uig/gid, and have predictable home
17 # directories, you can use the static userdb module to generate the home
18 # dir based on the username and domain. In this case, you won't need fields
19 # for home, uid, or gid in the database.
21 # If you prefer to use the sql userdb module, you'll want to add fields
22 # for home, uid, and gid. Here is an example table:
24 # CREATE TABLE users (
25 # username VARCHAR(128) NOT NULL,
26 # domain VARCHAR(128) NOT NULL,
27 # password VARCHAR(64) NOT NULL,
28 # home VARCHAR(255) NOT NULL,
29 # uid INTEGER NOT NULL,
30 # gid INTEGER NOT NULL,
31 # active CHAR(1) DEFAULT 'Y' NOT NULL
34 # Database driver: mysql, pgsql, sqlite
37 # Database connection string. This is driver-specific setting.
40 # For available options, see the PostgreSQL documention for the
41 # PQconnectdb function of libpq.
44 # Basic options emulate PostgreSQL option names:
45 # host, port, user, password, dbname
47 # But also adds some new settings:
48 # client_flags - See MySQL manual
49 # ssl_ca, ssl_ca_path - Set either one or both to enable SSL
50 # ssl_cert, ssl_key - For sending client-side certificates to server
51 # ssl_cipher - Set minimum allowed cipher security (default: HIGH)
52 # option_file - Read options from the given file instead of
53 # the default my.cnf location
54 # option_group - Read options from the given group (default: client)
56 # You can connect to UNIX sockets by using host: host=/var/run/mysqld/mysqld.sock
57 # Note that currently you can't use spaces in parameters.
59 # MySQL supports multiple host parameters for load balancing / HA.
62 # The path to the database file.
65 # connect = host=192.168.1.1 dbname=users
66 # connect = host=sql.example.com dbname=virtual user=virtual password=blarg
67 # connect = /etc/dovecot/authdb.sqlite
69 connect = host=%%dbhost%% dbname=%%dbname%% user=%%db_mail_user%% password=%%db_mail_pwd%%
71 # Default password scheme.
73 # List of supported schemes is in
74 # http://wiki.dovecot.org/Authentication/PasswordSchemes
76 default_pass_scheme = MD5
78 # passdb query to retrieve the password. It can return fields:
79 # password - The user's password. This field must be returned.
80 # user - user@domain from the database. Needed with case-insensitive lookups.
81 # username and domain - An alternative way to represent the "user" field.
83 # The "user" field is often necessary with case-insensitive lookups to avoid
84 # e.g. "name" and "nAme" logins creating two different mail directories. If
85 # your user and domain names are in separate fields, you can return "username"
86 # and "domain" fields instead of "user".
88 # The query can also return other fields which have a special meaning, see
89 # http://wiki.dovecot.org/PasswordDatabase/ExtraFields
91 # Commonly used available substitutions (see http://wiki.dovecot.org/Variables
93 # %u = entire user@domain
94 # %n = user part of user@domain
95 # %d = domain part of user@domain
97 # Note that these can be used only as input to SQL query. If the query outputs
98 # any of these substitutions, they're not touched. Otherwise it would be
99 # difficult to have eg. usernames containing '%' characters.
102 # password_query = SELECT userid AS user, pw AS password \
103 # FROM users WHERE userid = '%u' AND active = 'Y'
106 # SELECT username, domain, password \
107 # FROM users WHERE username = '%n' AND domain = '%d'
109 # userdb query to retrieve the user information. It can return fields:
110 # uid - System UID (overrides mail_uid setting)
111 # gid - System GID (overrides mail_gid setting)
112 # home - Home directory
113 # mail - Mail location (overrides mail_location setting)
115 # None of these are strictly required. If you use a single UID and GID, and
116 # home or mail directory fits to a template string, you could use userdb static
117 # instead. For a list of all fields that can be returned, see
118 # http://wiki.dovecot.org/UserDatabase/ExtraFields
121 # user_query = SELECT home, uid, gid FROM users WHERE userid = '%u'
122 # user_query = SELECT dir AS home, user AS uid, group AS gid FROM users where userid = '%u'
123 # user_query = SELECT home, 501 AS uid, 501 AS gid FROM users WHERE userid = '%u'
125 user_query = SELECT userdb_home AS home, userdb_uid AS uid, 1998 AS gid, userdb_quota_rule AS quota_rule FROM dovecot_view WHERE user = '%u';
127 # If you wish to avoid two SQL lookups (passdb + userdb), you can use
128 # userdb prefetch instead of userdb sql in dovecot.conf. In that case you'll
129 # also have to return userdb fields in password_query prefixed with "userdb_"
130 # string. For example:
131 password_query = SELECT user, password, userdb_home, userdb_uid, 1998 AS userdb_gid,userdb_quota_rule FROM dovecot_view where user= '%u';