dovecot-sql.conf.ext.erb 5.6 KB

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