Skip to content

Commit

Permalink
global: Avoid explicit passdb/userdb_driver settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Feb 26, 2024
1 parent b4cd75f commit 66b10d2
Show file tree
Hide file tree
Showing 39 changed files with 109 additions and 217 deletions.
3 changes: 1 addition & 2 deletions source/configuration_manual/authentication/allow_nets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ Postfix to verify the email account:

.. code-block:: none
passdb db1 {
driver = static
passdb static {
args = password=test allow_nets=local,127.0.0.1/32
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Authenticates users against remote IMAP server in IP address 192.168.1.123:

.. code-block:: none
passdb db1 {
driver = imap
passdb imap {
args = host=192.168.1.123
}
3 changes: 1 addition & 2 deletions source/configuration_manual/authentication/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ use:

::

passdb db1 {
driver = pam
passdb pam {
args = cache_key=%{protocol}%u *
}

Expand Down
23 changes: 8 additions & 15 deletions source/configuration_manual/authentication/dict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ Auth configuration

.. code-block:: none
passdb db1 {
driver = dict
passdb dict {
args = /etc/dovecot/dovecot-dict-auth.conf
}
userdb db1 {
driver = dict
userdb dict {
args = /etc/dovecot/dovecot-dict-auth.conf
}
Expand Down Expand Up @@ -221,13 +219,11 @@ Auth configuration
auth = cdb:/etc/dovecot/auth.cdb
}
passdb db1 {
driver = dict
passdb dict {
args = /etc/dovecot/dovecot-cdb.conf
}
userdb db1 {
driver = dict
userdb dict {
args = /etc/dovecot/dovecot-cdb.conf
}
Expand Down Expand Up @@ -275,16 +271,13 @@ Auth configuration

.. code-block:: none
passdb db1 {
driver = dict
passdb dict {
args = /etc/dovecot/dovecot-dict-auth.conf
}
userdb db1 {
# optional
driver = prefetch
# optional
userdb prefetch {
}
userdb db2 {
driver = dict
userdb dict {
args = /etc/dovecot/dovecot-dict-auth.conf
}
Expand Down
15 changes: 5 additions & 10 deletions source/configuration_manual/authentication/domain_lost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,22 @@ user lookup.
::

## Your virtual passdb
passdb db1 {
driver = ldap
passdb ldap {
args = /path/to/ldap/config
}

passdb db2 {
driver = static
passdb static {
args = user=%Ld noauthenticate
skip = authenticated
}

passdb db3 {
driver = pam
passdb pam {
skip = authenticated
}

userdb db1 {
driver = ldap
userdb ldap {
args = /path/to/ldap/config
}

userdb db2 {
driver = passwd
userdb passwd {
}
12 changes: 4 additions & 8 deletions source/configuration_manual/authentication/kerberos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ If you only want to use Kerberos ticket-based authentication:
auth_mechanisms = gssapi
auth_krb5_keytab = /etc/dovecot/dovecot.keytab

userdb db1 {
driver = static
userdb static {
args = uid=vmail gid=vmail home=/var/vmail/%u
}

Expand All @@ -104,11 +103,9 @@ ticket-based authentication, you will need something like:
auth_gssapi_hostname = "$ALL"
auth_mechanisms = gssapi
auth_krb5_keytab = /etc/dovecot/dovecot.keytab
passdb db1 {
driver = pam
passdb pam {
}
userdb db1 {
driver = passwd
userdb passwd {
}

(Note that in this example, you will also need to configure PAM to use
Expand All @@ -131,8 +128,7 @@ Then enable PAM passdb:

::

passdb db1 {
driver = pam
passdb pam {
}

Check ``/var/log/auth.log`` if you have any problems logging in. The
Expand Down
9 changes: 3 additions & 6 deletions source/configuration_manual/authentication/ldap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ LDAP Backend Configuration

.. code-block:: none
passdb db1 {
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf.ext
driver = ldap
}
This enables LDAP to be used as passdb.
Expand Down Expand Up @@ -256,13 +255,11 @@ dovecot.conf:

.. code-block:: none
userdb db1 {
driver = ldap
userdb ldap {
args = /etc/dovecot/dovecot-users-ldap.conf.ext
result_success = continue-ok
}
userdb db2 {
driver = ldap
userdb ldap {
args = /etc/dovecot/dovecot-class-ldap.conf.ext
skip = notfound
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ See :ref:`LDAP <authentication-ldap>` for more details.

.. code-block:: none
passdb db1 {
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf.ext
driver = ldap
}
userdb db1 {
driver = prefetch
userdb prefetch {
}
userdb db2 {
userdb ldap {
args = /etc/dovecot/dovecot-ldap.conf.ext
driver = ldap
}
These enable ``LDAP`` to be used as ``passdb`` and ``userdb``. The userdb
Expand Down
6 changes: 2 additions & 4 deletions source/configuration_manual/authentication/ldap_bind.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ symlink to the first one. For example:

::

passdb db1 {
driver = ldap
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf.ext
}
userdb db1 {
driver = ldap
userdb ldap {
args = /etc/dovecot/dovecot-ldap-userdb.conf.ext
}

Expand Down
6 changes: 2 additions & 4 deletions source/configuration_manual/authentication/ldap_userdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,11 @@ dovecot.conf:

::

userdb db1 {
driver = ldap
userdb ldap {
args = /etc/dovecot/dovecot-users-ldap.conf.ext
result_success = continue-ok
}
userdb db2 {
driver = ldap
userdb ldap {
args = /etc/dovecot/dovecot-class-ldap.conf.ext
skip = notfound
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ Example
.. code:: none
passdb db1 {
driver = lua
passdb lua {
args = file=/etc/dovecot/auth.lua password={PLAIN}test
}
Expand Down Expand Up @@ -184,8 +183,7 @@ To configure passdb in dovecot, use

.. code-block:: none
passdb db1 {
driver = lua
passdb lua {
args = file=/path/to/lua blocking=yes # default is yes
}
Expand Down Expand Up @@ -218,8 +216,7 @@ To configure userdb in dovecot, use

.. code-block:: none
userdb db1 {
driver = lua
userdb lua {
args = file=/path/to/lua blocking=yes # default is yes
}
Expand Down
19 changes: 7 additions & 12 deletions source/configuration_manual/authentication/master_users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ Example configuration:
.. code-block:: none
auth_master_user_separator = *
passdb db1 {
driver = passwd-file
passdb passwd-file {
passwd_file_path = /etc/dovecot/passwd.masterusers
master = yes
result_success = continue
}
userdb db1 {
driver = passwd
userdb passwd {
}
To grant the masteruser access to all Mailboxes, the ``dovecot-acl`` file can
Expand Down Expand Up @@ -112,18 +110,17 @@ well:
.. code-block:: none
auth_master_user_separator = *
passdb db1 {
passdb sql1 {
driver = sql
args = /etc/dovecot/dovecot-sql-master.conf.ext
master = yes
result_success = continue
}
passdb db2 {
passdb sql2 {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
userdb db1 {
driver = sql
userdb sql {
args = /etc/dovecot/dovecot-sql.conf.ext
}
Expand Down Expand Up @@ -155,14 +152,12 @@ exists and get other extra fields.
.. code-block:: none
# master password passdb
passdb db1 {
driver = static
passdb static {
args = password=master-password
result_success = continue
}
# primary passdb
passdb db2 {
driver = pam
passdb pam {
}
Advanced SQL Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,19 @@ dovecot.conf:
mail_path = ~/Maildir
# try to authenticate using SQL database first
passdb db1 {
driver = sql
passdb sql {
args = /etc/dovecot/dovecot-sql.conf.ext
}
# fallback to PAM
passdb db2 {
driver = pam
passdb pam {
}
# look up users from SQL first (even if authentication was done using PAM!)
userdb db1 {
driver = sql
userdb sql {
args = /etc/dovecot/dovecot-sql.conf.ext
}
# if not found, fallback to /etc/passwd
userdb db2 {
driver = passwd
userdb passwd {
}
dovecot-sql.conf.ext:
Expand Down
12 changes: 4 additions & 8 deletions source/configuration_manual/authentication/oauth2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ In ``dovecot.conf`` put
xoauth2 = yes
}
passdb db1 {
driver = oauth2
passdb oauth2 {
mechanisms = xoauth2 oauthbearer
args = /etc/dovecot/dovecot-oauth2.conf.ext
}
Expand Down Expand Up @@ -75,8 +74,7 @@ Without proxy authentication

.. code-block:: none
passdb db1 {
driver = static
passdb static {
args = nopassword=y proxy=y proxy_mech=%m ...
}
Expand All @@ -98,14 +96,12 @@ passdb settings

.. code-block:: none
passdb db1 {
driver = oauth2
passdb oauth2 {
mechanisms = oauthbearer xoauth2
args = /usr/local/etc/dovecot/dovecot-oauth2.token.conf.ext
}
passdb db2 {
driver = oauth2
passdb oauth2 {
mechanisms = plain login
args = /usr/local/etc/dovecot/dovecot-oauth2.plain.conf.ext
}
Expand Down
Loading

0 comments on commit 66b10d2

Please sign in to comment.