Тема: Postfix+mysql
Решил сменить Сommunity Gate на Postfix, за основу взял статью http://sys-adm.org.ua/mail/mail-howto-p1.php#c6
Проблема появилась на отправке почты, прием почты и создание ящиков проблем нет все работает.
Вот мой конфиг main.cf, domain.ru - мой домен.
#
# /usr/local/etc/postfix/main.cf
#
queue_directory = /var/spool/postfix
base = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
mail_owner = postfix
default_privs = nobody
myhostname = domain.ru
mydomain = domain.ru
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = unix:passwd.byname $alias_maps
mynetworks = 127.0.0.0/8
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtpd_banner = $myhostname ESMTP
debug_peer_level = 2
smtpd_client_restrictions = permit_mynetworks,
permit_sasl_authenticated,
check_client_access hash:$base/client_access,
smtpd_helo_restrictions = check_helo_access hash:$base/hello_access,
permit_mynetworks,
permit_sasl_authenticated,
reject_invalid_helo_hostname,
reject_non_fqdn_helo_hostname,
reject_unknown_helo_hostname
smtpd_sender_restrictions = permit_mynetworks,
check_sender_access hash:$base/sender_access,
reject_authenticated_sender_login_mismatch,
reject_unlisted_sender,
reject_unverified_sender
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
check_recipient_access hash:$base/recipient_access,
reject_unlisted_recipient,
reject_unknown_recipient_domain,
reject_non_fqdn_recipient,
reject_unverified_recipient
smtpd_etrn_restrictions = reject
smtpd_reject_unlisted_sender = yes
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
show_user_unknown_table_name = no
address_verify_sender = <>
unverified_sender_reject_code = 550
smtpd_helo_required = yes
smtp_always_send_ehlo = yes
smtpd_hard_error_limit = 8
smtpd_sasl_auth_enable = yes
smtpd_sasl_application_name = smtpd
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sender_login_maps = mysql:$base/mysqlLookupMaps/sender.conf
virtual_alias_maps = mysql:$base/mysqlLookupMaps/alias.conf
virtual_mailbox_domains = mysql:$base/mysqlLookupMaps/domain.conf
virtual_mailbox_maps = mysql:$base/mysqlLookupMaps/mailbox.conf
virtual_mailbox_base = /var/spool/mail
virtual_mailbox_limit_maps = mysql:$base/mysqlLookupMaps/quota.conf
virtual_maildir_extended=yes
virtual_mailbox_limit_override=yes
virtual_create_maildirsize = yes
virtual_overquota_bounce = yes
virtual_maildir_limit_message="Sorry, the user's maildir has overdrawn his diskspace quota, please try again later"
message_size_limit = 5242880
virtual_gid_maps = static:1981
virtual_uid_maps = static:1981
virtual_minimum_uid = 1000Вот лог:
Jul 30 05:55:37 evalution postfix/smtpd[4305]: connect from unknown[195.1.1.1]
Jul 30 05:55:37 evalution postfix/smtpd[4305]: NOQUEUE: reject: RCPT from unknown[195.1.1.1]: 554 5.7.1 <test@mail.ru>: Relay access denied; from=<dimas@domain.ru> to=<test@mail.ru> proto=ESMTP helo=<[192.168.10.103]>
Jul 30 05:55:37 evalution postfix/smtpd[4305]: disconnect from unknown[195.1.1.1]Пробую зателнетиться в 25 порт
пробиваем пароль для пользователя: perl -MMIME::Base64 -e 'print encode_base64("\0dimas\@domain\.ru\000пас")'
получаем AGRpbWFzQGV2YWx1Glvbi5cmcAbmFj
пробуем пройти аунтификацию:
telnet domain.ru 25
Trying 213.1.1.1...
Connected to mydomain.ru.
Escape character is '^]'.
220 mydomain.ru ESMTP Postfix
ehlo dimas@domain.ru
250-mydomain.ru
250-PIPELINING
250-SIZE 10000000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN CRAM-MD5
250-AUTH=LOGIN PLAIN CRAM-MD5
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth plain
334
AGRpbWFzQGV2YWx1Glvbi5cmcAbmFj
535 5.7.8 Error: authentication failed: authentication failure# cat /usr/local/lib/sasl2/smtpd.conf
pwcheck_method: auxprop
mech_list: PLAIN LOGIN CRAM-MD5
auxprop_plugin: sql
sql_usessl: yes (пробовал и no)
sql_engine: mysql
sql_hostnames: localhost
sql_user: postfix
sql_passwd: postfix
sql_database: postfix
sql_select: select password from mailbox where username = '%u@%r'
log_level: 3Хоть убейте одно и тоже выдает Relay access denied, в main.cf пробовал уже убрать все рестрикшены.
Могу конечно сделать авторизацию по пользователям в системе, но это имхо слишком приметивно и не удобно.
Отредактировано Dimas (2010-07-30 10:03:55)

