Guest User

Untitled

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