This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 1 and 9 (spanning 8 versions)
Revision 1 as of 2006-05-12 23:14:32
Size: 416
Editor: TimoSirainen
Comment:
Revision 9 as of 2007-08-13 12:09:34
Size: 1918
Editor: TimoSirainen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
User is looked up using `getpwent()` call, which usually looks into `/etc/passwd` file, but depending on NSS configuration it may also look up the user from eg. LDAP database. User is looked up using `getpwnam()` call, which usually looks into `/etc/passwd` file, but depending on [http://en.wikipedia.org/wiki/Name_Service_Switch NSS] configuration it may also look up the user from eg. LDAP database.
Line 5: Line 5:
Most commonly used as user database. Many systems use shadow passwords nowadays so it doesn't usually work as password database. BSDs are an exception to this, they still set the password field even with shadow passwords. Most commonly used as a user database. Many systems use shadow passwords nowadays so it doesn't usually work as a password database. BSDs are an exception to this, they still set the password field even with shadow passwords.

The lookup is by default done in the primary dovecot-auth process, so if NSS is configured to do the lookups from an external server, it slows down all the other authentications while waiting for the reply. To avoid that, you can use {{{blocking=yes}}} argument to do the lookups in auth worker processes:

{{{
# NOTE: v1.0.rc23 and later only
userdb passwd {
  args = blocking=yes
}
}}}

The "blocking" name can be a bit confusing. It doesn't mean that the lookup blocks the whole dovecot-auth, exactly the opposite.

== Template overrides ==

v1.1+ only: It's possible to override fields from passwd and add new fields with templates. For example:

{{{
userdb passwd {
  args = home=/var/mail/%u mail=maildir:/var/mail/%u/Maildir
}
}}}

This uses the UID and GID fields from passwd, but home directory is overridden. Also the default [:MailLocation:mail_location] setting is overridden.

== nss_ldap ==

nss_ldap can in some cases return wrong user's information and cause users to log in as each others. With 1.0.rc23 and later you can fix this by using the {{{blocking=yes}}} setting as described above.

There's a nss_ldap bug about this in [https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154314 RedHat's Bugzilla].

A typical PAM + nss_ldap configuration looks like:

{{{
# NOTE: v1.0.rc23 and later only
  userdb passwd {
    args = blocking=yes
  }
  passdb pam {
    args = dovecot
  }
}}}

Passwd

User is looked up using getpwnam() call, which usually looks into /etc/passwd file, but depending on [http://en.wikipedia.org/wiki/Name_Service_Switch NSS] configuration it may also look up the user from eg. LDAP database.

Most commonly used as a user database. Many systems use shadow passwords nowadays so it doesn't usually work as a password database. BSDs are an exception to this, they still set the password field even with shadow passwords.

The lookup is by default done in the primary dovecot-auth process, so if NSS is configured to do the lookups from an external server, it slows down all the other authentications while waiting for the reply. To avoid that, you can use blocking=yes argument to do the lookups in auth worker processes:

# NOTE: v1.0.rc23 and later only
userdb passwd {
  args = blocking=yes
}

The "blocking" name can be a bit confusing. It doesn't mean that the lookup blocks the whole dovecot-auth, exactly the opposite.

Template overrides

v1.1+ only: It's possible to override fields from passwd and add new fields with templates. For example:

userdb passwd {
  args = home=/var/mail/%u mail=maildir:/var/mail/%u/Maildir
}

This uses the UID and GID fields from passwd, but home directory is overridden. Also the default [:MailLocation:mail_location] setting is overridden.

nss_ldap

nss_ldap can in some cases return wrong user's information and cause users to log in as each others. With 1.0.rc23 and later you can fix this by using the blocking=yes setting as described above.

There's a nss_ldap bug about this in [https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154314 RedHat's Bugzilla].

A typical PAM + nss_ldap configuration looks like:

# NOTE: v1.0.rc23 and later only
  userdb passwd {
    args = blocking=yes
  }
  passdb pam {
    args = dovecot
  }

None: AuthDatabase/Passwd (last edited 2019-09-11 14:08:34 by MichaelSlusarz)