Thanks Aki for the answer.
I did some tests and found a solution. I write down my experience It
could be useful to someone.
First I putted "passwd-file" passdb (only) before "pam" passdb, as Aki
suggested,
but "illegal seek error" persisted.
Then I putted both "passwd-file" passdb and "static" userdb before "pam"
passdb and "passwd" userdb (used for local user),
but that generated a strange behavior because "static" driver overrides
info also for local user.
Finally I putted both "passwd-file" passdb and "passwd-file" userdb
before "pam" and "passwd"
and that works without errors.
My working dovecot config:
host-prompt# dovecot -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-5-686-pae i686 Debian 7.11
auth_mechanisms = plain login
auth_username_format = %Ln
listen = *
log_timestamp = "%Y-%m-%d %H:%M:%S "
login_greeting = Server ready.
mail_full_filesystem_access = yes
mail_location = mbox:~/:INBOX=/var/mail/%u:INDEX=/var/index/%u
mail_privileged_group = mail
passdb {
args = scheme=MD5-CRYPT username_format=%n /etc/dovecot/users
driver = passwd-file
}
passdb {
driver = pam
}
protocols = " imap"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
user = root
}
service imap-login {
inet_listener imap {
port = 0
}
}
ssl_cert = to avoid writing uid,gid,home for each user, but in the end, with
passwd-file and
override_fields i got the desired scenario.
Regards,
Claudio
Il 30/03/18 14:27, Aki Tuomi ha scritto:
On 30 March 2018 at 15:11 panetta <pane...@mat.unical.it> wrote:
Hi,
I recently configured dovecot to manage auth
for both local and virtual user.
When i login as a virtual user (claudio.panetta) I get the following
message:
dovecot: auth: Error:
passwd(claudio.panetta,160.97.62.1,): getpwnam()
failed: Illegal seek
but login is ok and sending/receiving email is ok,
how can, if possible, I suppress this error message?
In the following my dovecot config:
host-prompt# dovecot -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-5-686-pae i686 Debian 7.11
auth_mechanisms = plain login
auth_username_format = %Ln
listen = *
log_timestamp = "%Y-%m-%d %H:%M:%S "
login_greeting = Server ready.
mail_full_filesystem_access = yes
mail_location = mbox:~/:INBOX=/var/mail/%u:INDEX=/var/index/%u
mail_privileged_group = mail
passdb {
driver = pam
}
passdb {
args = scheme=MD5-CRYPT username_format=%n /etc/dovecot/users
driver = passwd-file
}
protocols = " imap"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
user = root
}
service imap-login {
inet_listener imap {
port = 0
}
}
ssl_cert =
Hi! Put the file based passdb before the pam one. Also not sure what you are
trying to do with the static userdb. It looks like you wanted to use
passwd-file?
Aki