четверг, 17 февраля 2011 г.

exim4 + saslauthd + edir

/etc/saslauthd.conf

ldap_servers: ldap://slp.name
ldap_bind_dn: cn=for_mail,ou=internet,o=NAME
ldap_password: xxxy
ldap_version: 3
ldap_timeout: 10
ldap_cache_ttl: 30
ldap_cache_mem: 32768
ldap_scope: sub
ldap_search_base: o=NAME
ldap_auth_method: bind
ldap_filter: (&(&(cn=%U)(objectClass=Person))(groupmembership=cn=nds_all,ou=internet,o=NAME))





/etc/exim4/exim4.conf

begin authenticators


PLAIN:
driver = plaintext
public_name = PLAIN
server_condition = ${if saslauthd{{$2}{$3}}{1}{0}}

LOGIN:
driver=plaintext
public_name=LOGIN
server_set_id=$auth1
server_prompts="Username:: : Password::"
server_condition=${if saslauthd{{$1}{$2}}{1}{0}} 



Сгенерить строку авторизации:

perl -MMIME::Base64 -e 'print encode_base64("\0anonymous\0"."onanpass");'
AGFub255bW91cwBvbmFucGFzcw==



exim -bh   172.16.16.16

**** SMTP testing session as if from host 172.16.16.16
**** but without any ident (RFC 1413) callback.

**** This is not for real!

.......
220 post.domain.ru, ESMTP EXIM 4.75
ehlo localhost

.......

250-post2.domain.ru Hello localhost [172.16.16.25]
250-SIZE 25165824
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP

AUTH PLAIN AGFub255bW91cwBvbmFucGFzcw==
>>> PLAIN authenticator:
>>> $auth1 =
>>> $auth2 = anonymous 

>>> $auth3 = onanpass
>>> $1 =
>>> $2 = anonymous
>>> $3 = onanpass
>>> expanded string: 1
235 Authentication succeeded
quit
 221 post2.domain.ru closing connection


Комментариев нет: