postfix+SASL (проблемы...)

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модератор: SLEDopit

Ответить
Аватара пользователя
World Harm
Сообщения: 43
ОС: Slackware

postfix+SASL

Сообщение World Harm »

Привет всем! Нужна помощь по установке этой связки. Все нужные пакеты я поставил, но аутентификация на SMTP сервере не проходит. Вот конфиги и логи:

telnet> open localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 darkstar.ufrsrm.local ESMTP Postfix
ehlo localhost
250-darkstar.ufrsrm.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
250-AUTH=NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
250 8BITMIME
auth plain 'логин и пароль в base64'
535 Error: authentication failed

/etc/postfix/main.cf

Код: Выделить всё

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_use_tls=yes
#smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
#smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = darkstar.ufrsrm.local
mydomain = ufrsrm.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relayhost =
mynetworks = 194.168.1.0/24
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
#local_recipient_maps = mysql:/etc/postfix/mysql-local.cf

smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination


/etc/postfix/master.cf

Код: Выделить всё

#
# Postfix master process configuration file.  For details on the format
# of the file, see the Postfix master(5) manual page.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n      -       -       -       -       smtpd
#    -o smtpd_etrn_restrictions=reject
#    -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps    inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n      -       -       -       -       smtpd
#  -o smtpd_etrn_restrictions=reject
#  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
    -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache      unix    -    -    -    -    1    scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix    -    n    n    -    2    pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}


кусок /var/log/syslog

Код: Выделить всё

Oct 27 14:57:13 localhost postfix/smtpd[22651]: connect from localhost[127.0.0.1]
Oct 27 14:57:22 localhost postfix/smtpd[22651]: warning: SASL authentication problem: unknown password verifier
Oct 27 14:57:22 localhost postfix/smtpd[22651]: warning: SASL authentication failure: Password verification failed
Oct 27 14:57:22 localhost postfix/smtpd[22651]: warning: localhost[127.0.0.1]: SASL plain authentication failed
Oct 27 14:57:27 localhost postfix/smtpd[22651]: disconnect from localhost[127.0.0.1]
...................

Oct 27 15:27:24 localhost postfix/smtpd[24215]: connect from localhost[127.0.0.1]
Oct 27 15:27:51 localhost postfix/smtpd[24215]: warning: SASL authentication failure: Can only find author (no password)
Oct 27 15:27:51 localhost postfix/smtpd[24215]: warning: localhost[127.0.0.1]: SASL plain authentication failed
Oct 27 15:28:37 localhost postfix/smtpd[24215]: disconnect from localhost[127.0.0.1]


В чём ошибка я понять не могу. Может кто-нибудь распишет по шагам установку??? Хотя бы простой случай без MySQL всяких и проч. Дистрибутив Ubuntu 6.06
Спасибо сказали:
Lazy
Сообщения: 115
ОС: RHEL 4, FreeBSD 5.x, Slackware

Re: postfix+SASL

Сообщение Lazy »

ищи статью "Настройка postfix с возможностью шифрования и защиты от вирусов и спама". там все достаточно толково расписано. единственное, что хотелось бы добавить, что существует как минимум 2 способа аутентификации в SASL - через демон saslauthd и встроенным. иногда их смешивают в кучу.
Спасибо сказали:
Аватара пользователя
World Harm
Сообщения: 43
ОС: Slackware

Re: postfix+SASL

Сообщение World Harm »

Спасибо за совет. Дело в том, что я перечитал таких статей туеву хучу и один хрен ничё у меня не получилось. Мне бы хотелось прочитать описание установки в более простом виде. Например так: "запустить такие-то демоны, поправить то-то в конфигах"... Ну чё-нибудь в таком духе, без больших выкладок про типы аутентификации и проч. теории. Я в первую очередь прошу помощи у людей, которые это всё ставили и настраивали. Хотелось бы видеть их ход настройки.
Спасибо сказали:
Lazy
Сообщения: 115
ОС: RHEL 4, FreeBSD 5.x, Slackware

Re: postfix+SASL

Сообщение Lazy »

судя по твоим логам, у тебя не порходит аутентификация. проверь, установлен ли Cyrus-SASL2. если да, то выпиши, что написано в smtpd.conf (нахождение зависит от дистрибутива).
Спасибо сказали:
Аватара пользователя
World Harm
Сообщения: 43
ОС: Slackware

Re: postfix+SASL

Сообщение World Harm »

Да, я сам понял, что у меня не проходит аутентификация. Пакеты все есть. Это я первым делом проверяю, если чё-то не идёт. Вот smtpd.conf (/etc/postfix/sasl/smtpd.conf)

Код: Выделить всё

auto_transition: true
pwcheck_method: sasldb
Спасибо сказали:
Lazy
Сообщения: 115
ОС: RHEL 4, FreeBSD 5.x, Slackware

Re: postfix+SASL

Сообщение Lazy »

World Harm писал(а):
02.11.2006 12:40
Да, я сам понял, что у меня не проходит аутентификация. Пакеты все есть. Это я первым делом проверяю, если чё-то не идёт. Вот smtpd.conf (/etc/postfix/sasl/smtpd.conf)

Код: Выделить всё

auto_transition: true
pwcheck_method: sasldb


для SASL версии 2 используется не sasldb, а auxprop. подробности в документации в постфитксу SASL_README.
Спасибо сказали:
Аватара пользователя
World Harm
Сообщения: 43
ОС: Slackware

Re: postfix+SASL

Сообщение World Harm »

Значение поменял, всё равно не работает. Ну и чёрт с ним. Попробую в другом дистре понастраивать.
Спасибо сказали:
Аватара пользователя
krz
Сообщения: 50

Re: postfix+SASL

Сообщение krz »

World Harm писал(а):
03.11.2006 15:37
Значение поменял, всё равно не работает. Ну и чёрт с ним. Попробую в другом дистре понастраивать.


У меня в smtpd.conf вот так >

auxprop_plugin: mysql
pwcheck_method: auxprop
mysql_user: mAiL
mysql_passwd: mYpAsSwOrD
mysql_hostnames: localhost
mysql_database: mail
mysql_statement: select password from aliases where alias='%u@%r'
mysql_verbose: yes

тоже долго боролся с этой проблемой, дело оказалось в том что я тестил аутентификацию с ущербным Outloock. а он передаёт пароль и логин по методу "Login" (передача в чистом виде) чего у меня не было скомпилено в SASL

И чисто случайно я заметил как один из пользователей, сидящий на макинтоше прошёл аутентификацию
Проверил BATом и всё прошло нормально
Статей перечитал кучу и нигде не попадалось ответа что трабла частично сидела в почтовом клиенте
Спасибо сказали:
Lazy
Сообщения: 115
ОС: RHEL 4, FreeBSD 5.x, Slackware

Re: postfix+SASL

Сообщение Lazy »

во Фре мне пришлось патчить перед сборкой SASL2. есть такая проблема... правда в доках об этом написано и патчи валяются везде.
Спасибо сказали:
Аватара пользователя
World Harm
Сообщения: 43
ОС: Slackware

Re: postfix+SASL

Сообщение World Harm »

Аутентификацию я пробовал телнетом. Так что с клиентским ПО точно нормально всё :) . Попробую smtpd.conf изменить, мож чё и получиЦЦо.
Спасибо сказали:
Ответить