Advertisement
Guest User

Untitled

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