From 3d9db880fa0ad8fc3f35b07d1e694f82b1cc4ef4 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 6 Mar 2010 16:34:52 +0200 Subject: [PATCH] example-config: Moved passdbs and userdbs to separate auth-*.conf.ext files. --HG-- branch : HEAD --- doc/example-config/conf.d/Makefile.am | 8 + .../conf.d/auth-checkpassword.conf.ext | 21 ++ doc/example-config/conf.d/auth-deny.conf.ext | 15 ++ doc/example-config/conf.d/auth-ldap.conf.ext | 22 ++ .../conf.d/auth-master.conf.ext | 16 ++ .../conf.d/auth-passwdfile.conf.ext | 14 ++ doc/example-config/conf.d/auth-sql.conf.ext | 22 ++ .../conf.d/auth-system.conf.ext | 71 +++++++ .../conf.d/auth-vpopmail.conf.ext | 15 ++ doc/example-config/conf.d/auth.conf | 190 +----------------- 10 files changed, 213 insertions(+), 181 deletions(-) create mode 100644 doc/example-config/conf.d/auth-checkpassword.conf.ext create mode 100644 doc/example-config/conf.d/auth-deny.conf.ext create mode 100644 doc/example-config/conf.d/auth-ldap.conf.ext create mode 100644 doc/example-config/conf.d/auth-master.conf.ext create mode 100644 doc/example-config/conf.d/auth-passwdfile.conf.ext create mode 100644 doc/example-config/conf.d/auth-sql.conf.ext create mode 100644 doc/example-config/conf.d/auth-system.conf.ext create mode 100644 doc/example-config/conf.d/auth-vpopmail.conf.ext diff --git a/doc/example-config/conf.d/Makefile.am b/doc/example-config/conf.d/Makefile.am index 6b7a768507..7c5af864d7 100644 --- a/doc/example-config/conf.d/Makefile.am +++ b/doc/example-config/conf.d/Makefile.am @@ -3,6 +3,14 @@ pkgsysconfdir = $(sysconfdir)/dovecot exampledir = $(docdir)/example-config/conf.d example_DATA = \ auth.conf \ + auth-checkpassword.conf.ext \ + auth-deny.conf.ext \ + auth-ldap.conf.ext \ + auth-master.conf.ext \ + auth-passwdfile.conf.ext \ + auth-sql.conf.ext \ + auth-system.conf.ext \ + auth-vpopmail.conf.ext \ imap.conf \ lda.conf \ lmtp.conf \ diff --git a/doc/example-config/conf.d/auth-checkpassword.conf.ext b/doc/example-config/conf.d/auth-checkpassword.conf.ext new file mode 100644 index 0000000000..02efae33ec --- /dev/null +++ b/doc/example-config/conf.d/auth-checkpassword.conf.ext @@ -0,0 +1,21 @@ +# Authentication for checkpassword users. Included from auth.conf. +# +# + +passdb { + driver = checkpassword + args = /usr/bin/checkpassword +} + +# passdb lookup should return also userdb info +userdb { + driver = prefetch +} + +# Standard checkpassword doesn't support direct userdb lookups. +# If you need checkpassword userdb, the checkpassword must support +# Dovecot-specific extensions. +#userdb { +# driver = checkpassword +# args = /usr/bin/checkpassword +#} diff --git a/doc/example-config/conf.d/auth-deny.conf.ext b/doc/example-config/conf.d/auth-deny.conf.ext new file mode 100644 index 0000000000..f2d897d1d1 --- /dev/null +++ b/doc/example-config/conf.d/auth-deny.conf.ext @@ -0,0 +1,15 @@ +# Deny access for users. Included from auth.conf. + +# Users can be (temporarily) disabled by adding a passdb with deny=yes. +# If the user is found from that database, authentication will fail. +# The deny passdb should always be specified before others, so it gets +# checked first. + +# Example deny passdb using passwd-file. You can use any passdb though. +passdb { + driver = passwd-file + deny = yes + + # File contains a list of usernames, one per line + args = /etc/dovecot/deny-users +} diff --git a/doc/example-config/conf.d/auth-ldap.conf.ext b/doc/example-config/conf.d/auth-ldap.conf.ext new file mode 100644 index 0000000000..a4f3334389 --- /dev/null +++ b/doc/example-config/conf.d/auth-ldap.conf.ext @@ -0,0 +1,22 @@ +# Authentication for LDAP users. Included from auth.conf. +# +# + +passdb { + driver = ldap + + # Path for LDAP configuration file, see example-config/dovecot-ldap.conf.ext + args = /etc/dovecot/dovecot-ldap.conf.ext +} + +# "prefetch" user database means that the passdb already provided the +# needed information and there's no need to do a separate userdb lookup. +# +#userdb { +# driver = prefetch +#} + +userdb { + driver = ldap + args = /etc/dovecot/dovecot-ldap.conf.ext +} diff --git a/doc/example-config/conf.d/auth-master.conf.ext b/doc/example-config/conf.d/auth-master.conf.ext new file mode 100644 index 0000000000..8e5107fd4f --- /dev/null +++ b/doc/example-config/conf.d/auth-master.conf.ext @@ -0,0 +1,16 @@ +# Authentication for master users. Included from auth.conf. + +# By adding master=yes setting inside a passdb you make the passdb a list +# of "master users", who can log in as anyone else. +# + +# Example master user passdb using passwd-file. You can use any passdb though. +passdb { + driver = passwd-file + master = yes + args = /etc/dovecot/master-users + + # Unless you're using PAM, you probably still want the destination user to + # be looked up from passdb that it really exists. pass=yes does that. + pass = yes +} diff --git a/doc/example-config/conf.d/auth-passwdfile.conf.ext b/doc/example-config/conf.d/auth-passwdfile.conf.ext new file mode 100644 index 0000000000..3f57ceebdf --- /dev/null +++ b/doc/example-config/conf.d/auth-passwdfile.conf.ext @@ -0,0 +1,14 @@ +# Authentication for passwd-file users. Included from auth.conf. +# +# passwd-like file with specified location. +# + +passdb { + driver = passwd-file + args = scheme=CRYPT username_format=%u /etc/dovecot/users +} + +userdb { + driver = passwd-file + args = username_format=%u /etc/dovecot/users +} diff --git a/doc/example-config/conf.d/auth-sql.conf.ext b/doc/example-config/conf.d/auth-sql.conf.ext new file mode 100644 index 0000000000..9d69fb8e2f --- /dev/null +++ b/doc/example-config/conf.d/auth-sql.conf.ext @@ -0,0 +1,22 @@ +# Authentication for SQL users. Included from auth.conf. +# +# + +passdb { + driver = sql + + # Path for SQL configuration file, see example-config/dovecot-sql.conf.ext + args = /etc/dovecot/dovecot-sql.conf.ext +} + +# "prefetch" user database means that the passdb already provided the +# needed information and there's no need to do a separate userdb lookup. +# +#userdb { +# driver = prefetch +#} + +userdb { + driver = sql + args = /etc/dovecot/dovecot-sql.conf.ext +} diff --git a/doc/example-config/conf.d/auth-system.conf.ext b/doc/example-config/conf.d/auth-system.conf.ext new file mode 100644 index 0000000000..2a23cef47d --- /dev/null +++ b/doc/example-config/conf.d/auth-system.conf.ext @@ -0,0 +1,71 @@ +# Authentication for system users. Included from auth.conf. +# +# +# + +# PAM authentication. Preferred nowadays by most systems. +# PAM is typically used with either userdb passwd or userdb static. +# REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM +# authentication to actually work. +passdb { + driver = pam + # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=] + # [cache_key=] [] + #args = dovecot +} + +# System users (NSS, /etc/passwd, or similiar). +# In many systems nowadays this uses Name Service Switch, which is +# configured in /etc/nsswitch.conf. +#passdb { + #driver = passwd + # [blocking=yes] + #args = +#} + +# Shadow passwords for system users (NSS, /etc/shadow or similiar). +# Deprecated by PAM nowadays. +# +#passdb { + #driver = shadow + # [blocking=yes] + #args = +#} + +# PAM-like authentication for OpenBSD. +# +#passdb { + #driver = bsdauth + # [cache_key=] + #args = +#} + +## +## User databases +## + +# System users (NSS, /etc/passwd, or similiar). In many systems nowadays this +# uses Name Service Switch, which is configured in /etc/nsswitch.conf. +userdb { + # + driver = passwd + # [blocking=no] + #args = +} + +# Static settings generated from template +#userdb { + #driver = static + # Can return anything a userdb could normally return. For example: + # + # args = uid=500 gid=500 home=/var/mail/%u + # + # LDA and LMTP needs to look up users only from the userdb. This of course + # doesn't work with static userdb because there is no list of users. + # Normally static userdb handles this by doing a passdb lookup. This works + # with most passdbs, with PAM being the most notable exception. If you do + # the user verification another way, you can add allow_all_users=yes to + # the args in which case the passdb lookup is skipped. + # + #args = +#} diff --git a/doc/example-config/conf.d/auth-vpopmail.conf.ext b/doc/example-config/conf.d/auth-vpopmail.conf.ext new file mode 100644 index 0000000000..71f1dcbf5e --- /dev/null +++ b/doc/example-config/conf.d/auth-vpopmail.conf.ext @@ -0,0 +1,15 @@ +# Authentication for vpopmail users. Included from auth.conf. +# +# + +passdb { + driver = vpopmail + + # [cache_key=] + # [quota_template=