10-auth.conf.erb 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. ##
  2. ## Authentication processes
  3. ##
  4. # Disable LOGIN command and all other plaintext authentications unless
  5. # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
  6. # matches the local IP (ie. you're connecting from the same computer), the
  7. # connection is considered secure and plaintext authentication is allowed.
  8. <% unless @conf['disable_plaintext_auth'].nil? -%>
  9. disable_plaintext_auth = <%= Dovecot::Conf.value(@conf['disable_plaintext_auth']) %>
  10. <% else -%>
  11. #disable_plaintext_auth = yes
  12. <% end -%>
  13. # Authentication cache size (e.g. 10M). 0 means it's disabled. Note that
  14. # bsdauth, PAM and vpopmail require cache_key to be set for caching to be used.
  15. <% unless @conf['auth_cache_size'].nil? -%>
  16. auth_cache_size = <%= Dovecot::Conf.value(@conf['auth_cache_size']) %>
  17. <% else -%>
  18. #auth_cache_size = 0
  19. <% end -%>
  20. # Time to live for cached data. After TTL expires the cached record is no
  21. # longer used, *except* if the main database lookup returns internal failure.
  22. # We also try to handle password changes automatically: If user's previous
  23. # authentication was successful, but this one wasn't, the cache isn't used.
  24. # For now this works only with plaintext authentication.
  25. <% unless @conf['auth_cache_ttl'].nil? -%>
  26. auth_cache_ttl = <%= Dovecot::Conf.value(@conf['auth_cache_ttl']) %>
  27. <% else -%>
  28. #auth_cache_ttl = 1 hour
  29. <% end -%>
  30. # TTL for negative hits (user not found, password mismatch).
  31. # 0 disables caching them completely.
  32. <% unless @conf['auth_cache_negative_ttl'].nil? -%>
  33. auth_cache_negative_ttl = <%= Dovecot::Conf.value(@conf['auth_cache_negative_ttl']) %>
  34. <% else -%>
  35. #auth_cache_negative_ttl = 1 hour
  36. <% end -%>
  37. # Space separated list of realms for SASL authentication mechanisms that need
  38. # them. You can leave it empty if you don't want to support multiple realms.
  39. # Many clients simply use the first one listed here, so keep the default realm
  40. # first.
  41. <% unless @conf['auth_realms'].nil? -%>
  42. auth_realms = <%= Dovecot::Conf.value(@conf['auth_realms']) %>
  43. <% else -%>
  44. #auth_realms =
  45. <% end -%>
  46. # Default realm/domain to use if none was specified. This is used for both
  47. # SASL realms and appending @domain to username in plaintext logins.
  48. <% unless @conf['auth_default_realm'].nil? -%>
  49. auth_default_realm = <%= Dovecot::Conf.value(@conf['auth_default_realm']) %>
  50. <% else -%>
  51. #auth_default_realm =
  52. <% end -%>
  53. # List of allowed characters in username. If the user-given username contains
  54. # a character not listed in here, the login automatically fails. This is just
  55. # an extra check to make sure user can't exploit any potential quote escaping
  56. # vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
  57. # set this value to empty.
  58. <% unless @conf['auth_username_chars'].nil? -%>
  59. auth_username_chars = <%= Dovecot::Conf.value(@conf['auth_username_chars']) %>
  60. <% else -%>
  61. #auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
  62. <% end -%>
  63. # Username character translations before it's looked up from databases. The
  64. # value contains series of from -> to characters. For example "#@/@" means
  65. # that '#' and '/' characters are translated to '@'.
  66. <% unless @conf['auth_username_translation'].nil? -%>
  67. auth_username_translation = <%= Dovecot::Conf.value(@conf['auth_username_translation']) %>
  68. <% else -%>
  69. #auth_username_translation =
  70. <% end -%>
  71. # Username formatting before it's looked up from databases. You can use
  72. # the standard variables here, eg. %Lu would lowercase the username, %n would
  73. # drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
  74. # "-AT-". This translation is done after auth_username_translation changes.
  75. <% unless @conf['auth_username_format'].nil? -%>
  76. auth_username_format = <%= Dovecot::Conf.value(@conf['auth_username_format']) %>
  77. <% else -%>
  78. #auth_username_format =
  79. <% end -%>
  80. # If you want to allow master users to log in by specifying the master
  81. # username within the normal username string (ie. not using SASL mechanism's
  82. # support for it), you can specify the separator character here. The format
  83. # is then <username><separator><master username>. UW-IMAP uses "*" as the
  84. # separator, so that could be a good choice.
  85. <% unless @conf['auth_master_user_separator'].nil? -%>
  86. auth_master_user_separator = <%= Dovecot::Conf.value(@conf['auth_master_user_separator']) %>
  87. <% else -%>
  88. #auth_master_user_separator =
  89. <% end -%>
  90. # Username to use for users logging in with ANONYMOUS SASL mechanism
  91. <% unless @conf['auth_anonymous_username'].nil? -%>
  92. auth_anonymous_username = <%= Dovecot::Conf.value(@conf['auth_anonymous_username']) %>
  93. <% else -%>
  94. #auth_anonymous_username = anonymous
  95. <% end -%>
  96. # Maximum number of dovecot-auth worker processes. They're used to execute
  97. # blocking passdb and userdb queries (eg. MySQL and PAM). They're
  98. # automatically created and destroyed as needed.
  99. <% unless @conf['auth_worker_max_count'].nil? -%>
  100. auth_worker_max_count = <%= Dovecot::Conf.value(@conf['auth_worker_max_count']) %>
  101. <% else -%>
  102. #auth_worker_max_count = 30
  103. <% end -%>
  104. # Host name to use in GSSAPI principal names. The default is to use the
  105. # name returned by gethostname(). Use "$ALL" (with quotes) to allow all keytab
  106. # entries.
  107. <% unless @conf['auth_gssapi_hostname'].nil? -%>
  108. auth_gssapi_hostname = <%= Dovecot::Conf.value(@conf['auth_gssapi_hostname']) %>
  109. <% else -%>
  110. #auth_gssapi_hostname =
  111. <% end -%>
  112. # Kerberos keytab to use for the GSSAPI mechanism. Will use the system
  113. # default (usually /etc/krb5.keytab) if not specified. You may need to change
  114. # the auth service to run as root to be able to read this file.
  115. <% unless @conf['auth_krb5_keytab'].nil? -%>
  116. auth_krb5_keytab = <%= Dovecot::Conf.value(@conf['auth_krb5_keytab']) %>
  117. <% else -%>
  118. #auth_krb5_keytab =
  119. <% end -%>
  120. # Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and
  121. # ntlm_auth helper. <doc/wiki/Authentication/Mechanisms/Winbind.txt>
  122. <% unless @conf['auth_use_winbind'].nil? -%>
  123. auth_use_winbind = <%= Dovecot::Conf.value(@conf['auth_use_winbind']) %>
  124. <% else -%>
  125. #auth_use_winbind = no
  126. <% end -%>
  127. # Path for Samba's ntlm_auth helper binary.
  128. <% unless @conf['auth_winbind_helper_path'].nil? -%>
  129. auth_winbind_helper_path = <%= Dovecot::Conf.value(@conf['auth_winbind_helper_path']) %>
  130. <% else -%>
  131. #auth_winbind_helper_path = /usr/bin/ntlm_auth
  132. <% end -%>
  133. # Time to delay before replying to failed authentications.
  134. <% unless @conf['auth_failure_delay'].nil? -%>
  135. auth_failure_delay = <%= Dovecot::Conf.value(@conf['auth_failure_delay']) %>
  136. <% else -%>
  137. #auth_failure_delay = 2 secs
  138. <% end -%>
  139. # Require a valid SSL client certificate or the authentication fails.
  140. <% unless @conf['auth_ssl_require_client_cert'].nil? -%>
  141. auth_ssl_require_client_cert = <%= Dovecot::Conf.value(@conf['auth_ssl_require_client_cert']) %>
  142. <% else -%>
  143. #auth_ssl_require_client_cert = no
  144. <% end -%>
  145. # Take the username from client's SSL certificate, using
  146. # X509_NAME_get_text_by_NID() which returns the subject's DN's
  147. # CommonName.
  148. #auth_ssl_username_from_cert = no
  149. # Space separated list of wanted authentication mechanisms:
  150. # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
  151. # gss-spnego
  152. # NOTE: See also disable_plaintext_auth setting.
  153. <% unless @conf['auth_mechanisms'].nil? -%>
  154. auth_mechanisms = <%= Dovecot::Conf.value(@conf['auth_mechanisms']) %>
  155. <% else -%>
  156. #auth_mechanisms = plain
  157. <% end -%>
  158. ##
  159. ## Password and user databases
  160. ##
  161. #
  162. # Password database is used to verify user's password (and nothing more).
  163. # You can have multiple passdbs and userdbs. This is useful if you want to
  164. # allow both system users (/etc/passwd) and virtual users to login without
  165. # duplicating the system users into virtual database.
  166. #
  167. # <doc/wiki/PasswordDatabase.txt>
  168. #
  169. # User database specifies where mails are located and what user/group IDs
  170. # own them. For single-UID configuration use "static" userdb.
  171. #
  172. # <doc/wiki/UserDatabase.txt>
  173. <%= '#' unless @auth['deny'].kind_of?(Hash) %>!include auth-deny.conf.ext
  174. <%= '#' unless @auth['master'].kind_of?(Hash) %>!include auth-master.conf.ext
  175. <%= '#' unless @auth['system'].kind_of?(Hash) %>!include auth-system.conf.ext
  176. <%= '#' unless @auth['sql'].kind_of?(Hash) %>!include auth-sql.conf.ext
  177. <%= '#' unless @auth['ldap'].kind_of?(Hash) %>!include auth-ldap.conf.ext
  178. <%= '#' unless @auth['passwdfile'].kind_of?(Hash) %>!include auth-passwdfile.conf.ext
  179. <%= '#' unless @auth['checkpassword'].kind_of?(Hash) %>!include auth-checkpassword.conf.ext
  180. <%= '#' unless @auth['vpopmail'].kind_of?(Hash) %>!include auth-vpopmail.conf.ext
  181. <%= '#' unless @auth['static'].kind_of?(Hash) %>!include auth-static.conf.ext