# Dovecot + ldap  ".....Authenticated user not found"[SOLVED]

## Joper

Всем привет!

Пытаюсь настроить довекот на работы  с лдапом. Не авторизует юзера. Точнее вроде как авторизует, но почту не доставляет, в логах пишет ошибки. хотя судя по логам лдапа, все нужные атрибуты запрашиваются , пробовал лдапсёрчем под учёткой довекота- всё находит........

 Конфиги:

/etc/dovecot/dovecot.conf

```

base_dir = /var/run/dovecot/

log_path = /var/log/mail/dovecot.log

info_log_path = /var/log/mail/dovecot.log

ssl_disable = no

ssl_cert_file = /etc/dovecot/ssl/xxx.yyy-imap-cert.pem

ssl_key_file = /etc/dovecot/ssl/xxx.yyy-imap-key.pem

ssl_verify_client_cert = no

ssl_parameters_regenerate = 1

ssl_cipher_list = ALL:!LOW:!SSLv2

verbose_ssl = no

login_max_connections = 256

login_greeting =Welcome to XXX.YYY IMAP/POP3 server.

valid_chroot_dirs = /mail/domains

mail_location = maildir:/mail/domains/%d/mailboxes/%u/Maildir

mail_debug = yes

first_valid_uid = 1001

last_valid_uid = 1001

first_valid_gid = 1001

last_valid_gid = 1001

mbox_read_locks = fcntl

mbox_write_locks = dotlock fcntl

protocol imap {

     listen = 10.120.10.202:143

     ssl_listen = 10.120.10.202:993

}

protocol pop3 {

}

protocol lda {

  postmaster_address = postmaster@xxx.yyy

  hostname = xxx.yyy

}

auth default {

        mechanisms = plain

        passdb ldap {

                args = /etc/dovecot/dovecot-ldap.conf

        }

        userdb ldap {

                args = /etc/dovecot/dovecot-ldap.conf

        }

}

```

/etc/dovecot/dovecot-ldap.conf

```

uris = ldaps://ldap.xxx.yyy

dn = cn=dovecot,ou=SysUsers,ou=Main,dc=xxx,dc=yyy

dnpass = XXXXXXXXXXX

ldap_version = 3

base = ou=Users,ou=Main,dc=xxx,dc=yyy

scope = base

auth_bind = yes

user_attrs = homeDirectory=home

user_filter = (&(objectClass=CourierMailAccount)(mail=%u))

pass_attrs = mail=user,userPassword=password

pass_filter = (&(objectClass=CourierMailAccount)(mail=%u))

default_pass_scheme = MD5

user_global_uid = 1001

user_global_gid = 1001

```

dovecot.log

```

.......

dovecot: Feb 12 17:13:33 Error: auth(default): ldap(mailtest@xxx.yyy,192.168.1.254): Authenticated user not found

dovecot: Feb 12 17:13:33 Error: auth(default): userdb(mailtest@xxx.yyy,192.168.1.254): user not found from userdb

dovecot: Feb 12 17:13:33 Info: imap-login: Internal login failure: user=<mailtest@xxx.yyy>, method=PLAIN, rip=192.168.1.254, lip=10.120.10.202, TLS

....

```

Last edited by Joper on Wed Feb 13, 2008 11:43 am; edited 1 time in total

----------

## Joper

Блин, как обычно проблема в руках и глазах. 

```

scope = subtree

This tells Dovecot to search all entries that fall below the base entry. If it were set to "onelevel", Dovecot would search only entries one level below the base entry. If it were set to "base", Dovecot would search only the base entry.

```

А у мя стояло scope = base, т.е. поиск только в указанном DN

----------

