Skip to content

Commit

Permalink
configuration_manual: Update passwd userdb/passdb documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vmo69 committed Mar 27, 2024
1 parent ab9e29c commit 091e636
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
32 changes: 23 additions & 9 deletions source/configuration_manual/authentication/passwd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,44 @@ disabling it:
.. code-block:: none
userdb passwd {
args = blocking=no
userdb_use_worker = no
}
Field overriding and extra fields
=================================

It's possible to override fields from passwd and add :ref:`authentication-user_database_extra_fields` with templates, but in
v2.1+ it's done in a better way by using :dovecot_core:ref:`userdb_override_fields`.

It's possible to override fields from passwd and add :ref:`authentication-user_database_extra_fields`.
For example:

.. code-block:: none
userdb passwd {
override_fields {
home = /var/mail/%u
fields {
home = /var/mail/%{username}
mail_driver = maildir
mail_path = /var/mail/%u/Maildir
mail_path = /var/mail/%{username}/Maildir
}
}
This uses the UID and GID fields from passwd, but home directory is overridden.
Also the default :ref:`mail_location_settings`
setting is overridden.
Also the default :ref:`mail_location_settings` setting is overridden.

Please not that :dovecot_core:ref:`userdb_fields_import_all` defaults to ``yes``
if it is set to ``no`` the fields to be imported need to be explicitly defined.

Example:

.. code-block:: none
userdb passwd {
fields {
gid = %{passwd:uid:vmail}
gid = %{passwd:gid:vmail}
home = /var/mail/%{username}
mail_driver = maildir
mail_path = /var/mail/%{username}/Maildir
}
}
Passwd as a password database
=============================
Expand Down
4 changes: 2 additions & 2 deletions source/configuration_manual/quick_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ You need to create group vmail and user vmail.
}
userdb passwd {
args = blocking=no
override_fields {
userdb_use_worker = no
fields {
uid = vmail
gid = vmail
}
Expand Down

0 comments on commit 091e636

Please sign in to comment.