Автор Тема: Проблемы c sasl2 (Postfix+sasl2) [решено]  (Прочитано 3139 раз)

Оффлайн x_Ivan_x

  • Участник
  • *
  • Сообщений: 43
Всем привет. Дистр 6 платформа десктоп (так как неполучилось на школьных решил пробовать этот)

установил postfix, cyrus-sasl2, postfix-cyrus

метод авторизации sasl нужен shadow, где его прописать ненашёл.

если запускать             service saslauthd start             то testsaslauth не работает (testsaslauth -u root -p 123)

если запускать             saslauthd -a shadow                то testsaslauth  работает (testsaslauth -u root -p 123)


вот конфиг постфикса main.cf
# Global Postfix configuration file.  This file lists only a small subset
# of all parameters.  For the syntax, and for a complete parameter list,
# see the postconf(5) manual page.  For a commented and more complete
# version of this file see /etc/postfix/main.cf.dist

mailbox_command = /usr/bin/procmail -a $DOMAIN -d $LOGNAME
inet_interfaces =all
myhostname = mail.domain
mydomain = my.domain
mydestination = $mydomain, $myhostname, localhost
myorigin = $mydomain
mynetworks = 192.168.0.0/24
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

создал конфиг /usr/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login


в конфиге /etc/sasl2/saslauthd.conf закоментировал строки c ldap, с ними долго думает
#ldap_servers: ldap://10.1.1.15/ ldap://10.1.1.25/
#ldap_bind_dn: cn=operator,ou=Profile,o=foo.com
#ldap_bind_pw: secret
#ldap_version: 3
# <2|3>
# Specify the LDAP protocol version to use.

ldap_timeout: 5
# Specify a number of seconds a search can take before timing out.

ldap_time_limit: 5
# Specify a number of seconds for a search request to complete.

#ldap_deref: <none> <search|find|always|never>
# Specify how aliases dereferencing is handled during a search.

#ldap_referrals: <no>
# Specify whether or not the client should follow referrals.

#ldap_restart: <yes>
# Specify whether or not LDAP I/O operations are automatically restarted
# if they abort prematurely.

#ldap_cache_ttl: <0>
# Non zero enables client side caching.  Cached results will expire after
# specified number seconds, e.g. 30.  Use this option with care.
# OpenLDAP folks consider this feature experimental.

#ldap_cache_mem: <0>
# If client side caching is enabled, the value specifies the cache size
# in bytes,  e.g. 32768.

#ldap_scope: <sub> <sub|one|base>
# Search scope.

#ldap_search_base: <none>
# Specify a starting point for the search.  e.g. dc=foo,dc=com

#ldap_auth_method: <bind> <bind|custom>
# Specify an authentication method.  The default 'bind' method uses the
# LDAP simple bind facility to verify the password.  The custom method
# uses userPassword attribute to verify the password.  Currently, {CRYPT}
# hash is supported.

#ldap_filter: <uid=%u>
# Specify a filter.  Use the %u and %r tokens for the username and realm
# substitution.  The %u token has to be used at minimum for the filter to
# be useful.  If ldap_auth_method is 'bind', the filter will search for
# the DN (distinguished name) attribute.  Otherwise, the search will look
# for the userPassword attribute.

#ldap_debug: <0>
# Specify a debugging level in the OpenLDAP libraries.  See
# ldap_set_option(3) for more (LDAP_OPT_DEBUG_LEVEL).
#
#ldap_tls_check_peer: <no> <yes|no>
# Require and verify server certificate.  If this option is yes,
# you must specify ldap_tls_cacert_file or ldap_tls_cacert_dir.

#ldap_tls_cacert_file: <none>
# File containing CA (Certificate Authority) certificate(s).

#ldap_tls_cacert_dir: <none>
# Path to directory with CA (Certificate Authority) certificates.

#ldap_tls_ciphers: <DEFAULT>
# List of SSL/TLS ciphers to allow.  The format of the string is
# described in ciphers(1).

#ldap_tls_cert: <none>
# File containing the client certificate.

#ldap_tls_key: <none>
# File containing the private client key.

вот логи postfix
/var/log/mail/all
connect from test.ru[192.168.0.60]
Apr  9 01:15:23 mail postfix/smtpd[14563]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Apr  9 01:15:23 mail postfix/smtpd[14563]: warning: SASL authentication failure: Password verification failed
Apr  9 01:15:23 mail postfix/smtpd[14563]: warning: test.ru[192.168.0.60]: SASL PLAIN authentication failed: generic failure
Apr  9 01:15:23 mail postfix/smtpd[14563]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Apr  9 01:15:23 mail postfix/smtpd[14563]: warning: test.ru[192.168.0.60]: SASL LOGIN authentication failed: generic failure
Apr  9 01:15:23 mail postfix/smtpd[14563]: C96C8AB6D9: client=test.ru[192.168.0.60]
Apr  9 01:15:23 mail postfix/cleanup[14566]: C96C8AB6D9: message-id=<581624383.20120409101409@mail.domain>
Apr  9 01:15:23 mail postfix/qmgr[14555]: C96C8AB6D9: from=<lord@mail.domain>, size=664, nrcpt=1 (queue active)
Apr  9 01:15:23 mail postfix/smtpd[14563]: disconnect from test.ru[192.168.0.60]

Сам постфикс работает без проблем, неполучается только с авторизацией.

Какой файл он ненаходит (в логах)?

Такое ощущение, что что-то еще недонастроено.


подскажите куда копать.
Заранее благодарен.

« Последнее редактирование: 10.04.2012 11:55:04 от Skull »

Оффлайн x_Ivan_x

  • Участник
  • *
  • Сообщений: 43
Re: Проблемы c sasl2 (Postfix+sasl2)
« Ответ #1 : 09.04.2012 08:07:43 »
вот лог /var/log/mail/error
-------------------------------------------
Apr  9 04:02:44 mail postfix/smtp[6655]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:03:45 mail postfix/smtp[6656]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:04:47 mail postfix/smtp[6657]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:05:48 mail postfix/smtp[6659]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:06:49 mail postfix/smtp[6726]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:07:10 mail postfix/smtp[7044]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:08:11 mail postfix/smtp[7052]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:09:12 mail postfix/smtp[7055]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:10:13 mail postfix/smtp[7059]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
----------------------------------------------]
В конфиге /etc/sysconfig/saslauthd прописал
OPTIONS="-a pam -n 0" (вместо ldap)

теперь когда запускаю service saslauthd start testsaslauth работает нормально
но постфикс с sasl попрежнему неработает

Оффлайн x_Ivan_x

  • Участник
  • *
  • Сообщений: 43
Re: Проблемы c sasl2 (Postfix+sasl2)
« Ответ #2 : 09.04.2012 08:42:09 »
вот лог /var/log/mail/all после редактирования /ets/sysconfig/saslauthd
-------------------------------------------------------------------------------------------------
Apr  9 04:45:03 mail postfix/smtp[11231]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:45:04 mail postfix/master[11194]: warning: process /usr/libexec/postfix/smtp pid 11231 exit status 1
Apr  9 04:45:04 mail postfix/master[11194]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
Apr  9 04:45:07 mail postfix/smtpd[11209]: connect from test.ru[192.168.0.60]
Apr  9 04:45:07 mail postfix/smtpd[11209]: 0188CAB6E6: client=test.ru[192.168.0.60]
Apr  9 04:45:07 mail postfix/cleanup[11212]: 0188CAB6E6: message-id=<192298090.20120409134109@mail.domain>
Apr  9 04:45:07 mail postfix/qmgr[11201]: 0188CAB6E6: from=<lord@mail.domain>, size=674, nrcpt=1 (queue active)
Apr  9 04:45:07 mail postfix/smtpd[11209]: disconnect from test.ru[192.168.0.60]
Apr  9 04:45:10 mail postfix/smtpd[11209]: connect from test.ru[192.168.0.60]
Apr  9 04:45:10 mail postfix/smtpd[11209]: 345D5AB6E7: client=test.ru[192.168.0.60]
Apr  9 04:45:10 mail postfix/cleanup[11212]: 345D5AB6E7: message-id=<1731601776.20120409134113@mail.domain>
Apr  9 04:45:10 mail postfix/qmgr[11201]: 345D5AB6E7: from=<lord@mail.domain>, size=690, nrcpt=1 (queue active)
Apr  9 04:45:10 mail postfix/smtpd[11209]: disconnect from test.ru[192.168.0.60]
Apr  9 04:45:10 mail postfix/local[11213]: 345D5AB6E7: to=<lord@mail.domain>, relay=local, delay=0.05, delays=0.02/0/0/0.03, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -a $DOMAIN -d $LOGNAME)
Apr  9 04:45:10 mail postfix/qmgr[11201]: 345D5AB6E7: removed
Apr  9 04:46:04 mail postfix/smtp[11236]: fatal: open dictionary: expecting "type:name" form instead of "/ets/sasl2/sasldb2"
Apr  9 04:46:05 mail postfix/master[11194]: warning: process /usr/libexec/postfix/smtp pid 11236 exit status 1
Apr  9 04:46:05 mail postfix/master[11194]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
------------------------------------------------------------------------------------------------

Оффлайн x_Ivan_x

  • Участник
  • *
  • Сообщений: 43
Re: Проблемы c sasl2 (Postfix+sasl2)
« Ответ #3 : 10.04.2012 05:37:03 »
Всё разобрался сам. заработало!!!!!.
что сделал:
1) снёс установленную систему, т.к. много экспирементировал, много конфигов правил
2) поставил заново альт (шестую платформу десктоп)
3) руководствовался этой инструкцией

http://www.arccomm.ru/OpenSource/Linux_server/postfix_sasl.html

(только tls я неиспользовал)

Ну вот и всё.