<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Thanks Aki for the answer. <br>
    <br>
    <span id="result_box" class="short_text" lang="en"><span class="">I
        did some tests</span></span> and found a solution. I write down
    my experience <span id="result_box" class="short_text" lang="en"><span
        class="">It could be useful to someone.<br>
        <br>
      </span></span><span id="result_box" class="short_text" lang="en"><span
        class="">First I putted  "passwd-file" passdb (only)  before
        "pam" passdb, as Aki suggested,</span></span><br>
    <span id="result_box" class="short_text" lang="en"><span class="">but
        "illegal seek error" persisted.<br>
        <br>
      </span></span>Then I putted both "<span id="result_box"
      class="short_text" lang="en"><span class="">passwd-file</span></span>"
    passdb and "static" userdb before "pam" passdb and "passwd" userdb
    (used for local user),<br>
    but that generated a strange behavior because "static" driver
    overrides info also for local user.<br>
    <br>
    Finally I putted both "<span id="result_box" class="short_text"
      lang="en"><span class="">passwd-file</span></span>" passdb and "<span
      id="result_box" class="short_text" lang="en"><span class="">passwd-file"</span></span>
    userdb before "pam" and "passwd"<br>
    and that works without errors.<br>
    <br>
    My working dovecot config:<br>
    <br>
    host-prompt# dovecot -n<br>
    # 2.1.7: /etc/dovecot/dovecot.conf<br>
    # OS: Linux 3.2.0-5-686-pae i686 Debian 7.11 <br>
    auth_mechanisms = plain login<br>
    auth_username_format = %Ln<br>
    listen = *<br>
    log_timestamp = "%Y-%m-%d %H:%M:%S "<br>
    login_greeting = Server ready.<br>
    mail_full_filesystem_access = yes<br>
    mail_location = mbox:~/:INBOX=/var/mail/%u:INDEX=/var/index/%u<br>
    mail_privileged_group = mail<br>
    passdb {<br>
      args = scheme=MD5-CRYPT username_format=%n /etc/dovecot/users<br>
      driver = passwd-file<br>
    }<br>
    passdb {<br>
      driver = pam<br>
    }<br>
    protocols = " imap"<br>
    service auth {<br>
      unix_listener /var/spool/postfix/private/auth {<br>
        group = postfix<br>
        mode = 0660<br>
        user = postfix<br>
      }<br>
      user = root<br>
    }<br>
    service imap-login {<br>
      inet_listener imap {<br>
        port = 0<br>
      }<br>
    }<br>
    ssl_cert = </etc/ssl/certs/chained-cert-9599-ml.mat.unical.it.pem<br>
    ssl_key = </etc/ssl/private/csrkey-ml.mat.unical.it.pem<br>
    userdb {<br>
      args = username_format=%n /etc/dovecot/users<br>
      default_fields = mail=maildir:/var/vmail/%d/%n/Maildir/<br>
      driver = passwd-file<br>
      override_fields = uid=vmail gid=vmail home=/var/vmail/%d/%n<br>
    }<br>
    userdb {<br>
      driver = passwd<br>
    }<br>
    verbose_proctitle = yes<br>
    <br>
    <br>
    host-prompt# cat /etc/dovecot/users <br>
claudio.panetta:{MD5-CRYPT}$1$abcdefghijklmnopqrst:5000:5000::/var/vmail::<br>
ciccio.pasticcio:{MD5-CRYPT}$1$abcdefghijklmnopqrst:5000:5000::/var/vmail::<br>
    <br>
    <span id="result_box" class="short_text" lang="en"><span class="">At
        first I preferred </span></span><span id="result_box"
      class="short_text" lang="en"><span class=""><span id="result_box"
          class="short_text" lang="en"><span class="">(making a mistake)
          </span></span>static driver versus passwd-file </span></span><span
      id="result_box" class="short_text" lang="en"><span class=""></span></span><br>
    <span id="result_box" class="short_text" lang="en"><span class=""></span></span><span
      id="result_box" class="short_text" lang="en"><span class="">to
        avoid writing uid,gid,home for each user, but in the end, with
        passwd-file and</span></span><br>
    <span id="result_box" class="short_text" lang="en"><span class="">override_fields
        i got the desired scenario.<br>
        <br>
        Regards,<br>
        Claudio<br>
      </span></span><span id="result_box" class="short_text" lang="en"><span
        class=""></span></span>
    <p><span id="result_box" class="short_text" lang="en"><span class=""><br>
        </span></span></p>
    <div class="moz-cite-prefix">Il 30/03/18 14:27, Aki Tuomi ha
      scritto:<br>
    </div>
    <blockquote type="cite"
      cite="mid:609674583.2284.1522412873682@appsuite-dev.open-xchange.com">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">On 30 March 2018 at 15:11 panetta <a class="moz-txt-link-rfc2396E" href="mailto:panetta@mat.unical.it"><panetta@mat.unical.it></a> 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,<WLjlnZ9oRACgYT4B>): 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 = </etc/ssl/certs/chained-cert-9599-ml.mat.unical.it.pem
ssl_key = </etc/ssl/private/csrkey-ml.mat.unical.it.pem
userdb {
   driver = passwd
}
userdb {
   args = username_format=%n /etc/dovecot/users uid=vmail gid=vmail 
home=/var/vmail/%d/%n mail=maildir:/var/vmail/%d/%n/Maildir
   driver = static
}
verbose_proctitle = yes

host-prompt# cat /etc/dovecot/users
claudio.panetta:{MD5-CRYPT}$1$abcdefghijklmnopqrst
ciccio.pasticcio:{MD5-CRYPT}$1$abcdefghijklmnopqrst

Regards,
Claudio


</pre>
      </blockquote>
      <pre wrap="">
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
</pre>
    </blockquote>
    <br>
  </body>
</html>