Подскажите пожалуйста почему не работает saslПоставил по статье:
http://sudouser.com/ustanovka-pochtovogo-servera-postfix-dov...
всё поставилось работает но только без sasl по прописанным хостам в mynetworks =
мне сасл нужен как воздухC:\>telnet mydomain.ru 25
220 mydomain.ru ESMTP Postfix (Ubuntu)
ehlo host
250-mydomain.ru
250-PIPELINING
250-SIZE 102400
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: director
501 5.5.4 Syntax: MAIL FROM:<address>
director
502 5.5.2 Error: command not recognized
MAIL FROM: director@mydomain.ru
250 2.1.0 Ok
RCPT TO: director@mydomain.ru
250 2.1.5 Ok
AUTH PLAIN: 5c6a65f40890173e12f12bddd222261c5203 5.5.1 Error: authentication not enabledсобиралось так, может как то без сасла собралось?
# aptitude install mc htop dovecot-postfix postfix-mysql amavisd-new clamav razor pyzor spamassassinдля хранения логинов паролей используется mysql как написано тут:
http://sudouser.com/ustanovka-pochtovogo-servera-postfix-dov...сделал вроде всё по инструкции описвающие настройу сасал например отсюда
http://www.postfix.org/SASL_README.html#server_sasl_enable# cat main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem
smtpd_tls_key_file = /etc/ssl/private/postfix.pem
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = mydomain.ru
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.mydomain.ru, localhost.mydomain.ru, , localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot-postfix.conf -n -m "${EXTENSION}"
mailbox_size_limit = 204800000
message_size_limit = 102400
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yessmtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sender_restrictions = reject_unknown_sender_domain
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1# cat dovecot.conf
protocols = imap imaps pop3 pop3s
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n
namespace private {
separator = .
prefix = INBOX.
inbox = yes
}
mail_privileged_group = mail
protocol imap {
}
protocol pop3 {
pop3_uidl_format = XuXv
}
protocol managesieve {
sieve=~/.dovecot.sieve
sieve_storage=~/sieve
}protocol lda {
log_path = /home/vmail/dovecot-deliver.log
auth_socket_path = /var/run/dovecot/auth-master
postmaster_address = postmaster@mydomain.ru
mail_plugins = cmusieve
global_script_path = /home/vmail/globalsieverc
}
auth default {
mechanisms = plain login
passdb pam {
}
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb passwd {
}
userdb static {
args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
}
user = root
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0600
user = vmail
}
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}
dict {
}
plugin {
}еще
# ps -ax | grep dovecot
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
8060 ? Ss 0:00 /usr/sbin/dovecot
8062 ? S 0:00 dovecot-auth
8598 pts/2 R+ 0:00 grep dovecotкак узнать какой он конфиг цапанул
Решение:
Если по пунктам делаем всё как в статье http://sudouser.com/ustanovka-pochtovogo-servera-postfix-dov... ; /etc/postfix взяты такие какие были после инсталяции убунты), дальше делаем как написано нижеДоинсталируем:
#aptitude install libsasl2 sasl2-bin libsasl2-modules dovecot-postfixесли не инсталить dovecot-postfix довкат у меня живёт собственной жизнью, не реагировал на команды /etc/init.d/dovecot ;
sasl2-bin ставим для авторизации, собственно его и будем использовать нам нужен saslauthd,не забываем убить что бы dovecot не запускался с этим конфигом
#rm /etc/dovecot/dovecot-postfix.confпоказываем постфиксу где у нас оно
#/etc/init.d/saslauthd stop
#rm -r /var/run/saslauthd/
#mkdir -p /var/spool/postfix/var/run/saslauthd
#ln -s /var/spool/postfix/var/run/saslauthd /var/run
#chgrp sasl /var/spool/postfix/var/run/saslauthd
#adduser postfix saslЗабиваем на то что у нас main.cf и в dovecot.conf прописана сасл вторизация, по скольку у меня она и так не работает, а dovecot используется для проверки при приёме почты.
дальше делаем всё 1 в 1 по источнику
Источник http://workaround.org/ispmail/lenny/authenticated-smtp
привожу для полноты копию с источника:For everyone Who has had problems with smtp authentication
by Anonymous – 12/03/2009 – 13:38Ok guys,
First of all I’d have to thank the poster of this tutorial and the people who have left their comments here to help others.
As many of you have discovered, with newer versions of debian / ubuntu, such as karmic, this gets to major road block. That is the smtp auth plain command won’t work, and you cannot use smtp on your local mail clients either. Here’s why:t
saslauth is called to use a pam authentication and it doesn’t know where to look and you’ll be failed.
After extensive searching (over 48 hours of straight searching) and trying to debug, I found this link on howtoforge: http://www.howtoforge.com/virtual-users-domains-postfix-cour......
With some modifications of the page 2, we can finally get the smtp to work:
[1] edit /etc/default/saslauth and modify the respective fields:
START=yes
OPTIONS=»-c -m /var/spool/postfix/var/run/saslauthd -r»
[2] create a file: /etc/pam.d/smtp and add these two lines:
auth required pam_mysql.so user=mailuser passwd=mailuser2009 host=127.0.0.1 db=mailserver table=virtual_users usercolumn=email passwdcolumn=password crypt=0
account sufficient pam_mysql.so user=mailuser passwd=mailuser2009 host=127.0.0.1 db=mailserver table=virtual_users usercolumn=email passwdcolumn=password crypt=0
[3] create a file: /etc/postfix/sasl/smtpd.conf and add these lines:
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: mailuser
sql_passwd: mailuser2009
sql_database: mailserver
sql_select: select password from virtual_users where email = ‘%u’[4] then execute this shell command:
adduser postfix sasl
[5] modify /etc/postfix/main.cf and set
smtpd_tls_auth_only=no
[6] Then restart postfix and saslauthd
/etc/init.d/postfix restart
/etc/init.d/saslauthd restart