View Single Post
  #2  
Old 22nd August 2010, 03:59
dpicella dpicella is offline
Senior Member
 
Join Date: Apr 2009
Posts: 116
Thanks: 9
Thanked 8 Times in 7 Posts
Smile dovecot: lda: Fatal: Unknown user -> temporary solution

I managed to get it all working.

Modify the following dovecot cofig files

/etc/dovecot/conf.d/10-master.conf
Code:
[...]
service auth {
  # auth_socket_path points to this userdb socket by default. It's typically
  # used by dovecot-lda, doveadm, possibly imap process, etc. Its default
  # permissions make it readable only by root, but you may need to relax these
  # permissions. Users that have access to this socket are able to get a list
  # of all usernames and get results of everyone's userdb lookups.
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
    group = vmail
  }

  # Postfix smtp-auth
  #unix_listener /var/spool/postfix/private/auth {
  #  mode = 0666
  #}

  # Auth process is run as this user.
  #user = $default_internal_user
}
[...]
/etc/dovecot/conf.d/10-auth.conf
uncomment !include auth-sql.conf.ext
Code:
[...]
!include auth-system.conf.ext
!include auth-sql.conf.ext
#!include auth-ldap.conf.ex
[...]
Now modify /etc/dovecot/conf.d/auth-sql.conf.ext
as follows
Code:
# Authentication for SQL users. Included from auth.conf.
#
# <doc/wiki/AuthDatabase.SQL.txt>

passdb {
  driver = sql

  # Path for SQL configuration file, see example-config/dovecot-sql.conf.ext
  args = /etc/dovecot-sql.conf
}

# "prefetch" user database means that the passdb already provided the
# needed information and there's no need to do a separate userdb lookup.
# <doc/wiki/UserDatabase.Prefetch.txt>
#userdb {
#  driver = prefetch
#}

userdb {
  driver = sql
  args = /etc/dovecot-sql.conf
}

# If you don't have any user-specific settings, you can avoid the user_query
# by using userdb static instead of userdb sql, for example:
# <doc/wiki/UserDatabase.Static.txt>
#userdb {
  #driver = static
  #args = uid=vmail gid=vmail home=/var/vmail/%u
#}
Make sure that /etc/postfix/main.cf
has
Code:
virtual_transport = dovecot
... not maildrop

Take a look at the dovecot pipe above as I have it in /etc/dovecot/master.cf

Finally ... I was getting an SQL error. Basically, dovecot lda checks to see if the lda service has is active in the query. ISPConfig 3 does not seems to support activation/deactivation of dovecot lda ... so I changed it to imap

Here are the query lines I used in /etc/dovecot-sql.conf

Code:
password_query = SELECT password FROM mail_user WHERE email = '%u' AND disableimap = 'n'
user_query = SELECT email as user, maildir as home, CONCAT(maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disableimap = 'n'
Technically ... I don't think this is the correct way to do it. I am not an expert at dovecot deliver and lda. The only thing I can say is that I made it work.

Hopefully somebody who understands this a bit better can clarify what the requirements are here. This is only a workaround until proven otherwise.

Cheers!
Reply With Quote