I have an email server set to use dovecot with virtual users :
passdb {
driver = passwd-file
args = username_format=%n /etc/vmail/%d/users
}
userdb {
driver = static
args = uid=109 gid=111 home=/home/vmail/%d/%n
}
Now I need to set storage quotas for some users. Apparently this isn't possible with the static
driver, so I figured the simplest way to enable it would be to switch to passwd-file
. However I struggle to actually get it working.
Using the same passdb
as above and
userdb {
driver = passwd-file
args = username_format=%n /etc/vmail/%d/users
default_fields = uid=vmail gid=vmail home=/home/vmail/%d/%n
}
93.184.216.34 I get the following errors :
dovecot: imap: Error: Authenticated user not found from userdb, auth lookup id=345505793 (client-pid=30121 client-id=1)
dovecot: auth: Error: passwd-file([email protected],93.184.216.34,): user not found from userdb
I tried many variations and read many pages of the dovecot wiki, including AuthDatabase/PasswdFile, but I can't seem to interpret the documentation correctly.
How do I transpose my static
configuration into a passwd-file
with minimal modifications ?
/etc/vmail/%d/users
files are of the standard form
user:{SHA512}…
And here is the output of dovecot userdb
for these settings :
userdb {
args = username_format=%n /etc/vmail/%d/users
auth_verbose = default
default_fields = uid=vmail gid=vmail home=/home/vmail/%d/%n
driver = passwd-file
name =
override_fields =
result_failure = continue
result_internalfail = continue
result_success = return-ok
skip = never
}
Just to complement your answer, you only need two colons after the password field for the
default_values
inuserdb
to be picked up.Verification with
doveadm
gives also the home folder :I wrongly assumed that fields other than
user
andpassword
were optional sincedefault_fields
would take care of them.Actually, the documentation states (emphasis mine)
So those fields are actually mandatory. But since they are already set by
default_fields
, they can be empty :I figured it by chance because the only working account was the one I was testing the quota on (using the per user
userdb_quota_rule
extra field)…The
doveadm user [email protected]
was also very useful for debugging this issue.