URL: https://www.opennet.me/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 80703
[ Назад ]

Исходное сообщение
"Postfix+cyrus-sasl2+saslauthd+mysql"

Отправлено Beginner001 , 11-Июн-08 13:20 
Доброго времени суток.
Уважаемые форумчане, прошу вашей помощи.

Postfix+cyrus-sasl2+saslauthd+mysql+courier-imap развертываю впервые.
Развертываю по статье: http://www.citforum.ru/operating_systems/freebsd/freebsd4_st.../.

ОС: FreeBSD 6.3
Обнавил порты, установил Postfix+cyrus-sasl2+saslauthd+mysql

Интернета нет. Просто (на данном этапе) хочу проверить авторизацию в Mysql по smtp
Делаю тельнетом:

telnet localhost 25

av124161# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 av124161.test.ru MYLO
Mail from:test@test.ru

И все… Ответа просто нет.

Лог-файл maillog:

Jun 11 12:36:24 av124161 postfix/trivial-rewrite[1088]: fatal: mysql:/usr/local/etc/postfix/sql/users.cf(0,lock|fold_fix): table lookup problem
Jun 11 12:36:25 av124161 postfix/master[921]: warning: process /usr/local/libexec/postfix/trivial-rewrite pid 1088 exit status 1
Jun 11 12:36:25 av124161 postfix/master[921]: warning: /usr/local/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Jun 11 12:36:25 av124161 postfix/smtpd[1007]: warning: problem talking to service rewrite: Unknown error: 0
Jun 11 12:37:25 av124161 postfix/trivial-rewrite[1089]: warning: connect to mysql server localhost: Access denied for user 'mailer'@'localhost' (using password: YES)

Конфиги:
Sasl:

av124161# less smtpd.conf
pwcheck_method: saslauthd

saslauthd:

av124161# less pam.conf
smtp auth sufficient pam_mysql.so user=mailer passwd=alien db=mail
table=users usercolumn=login passwdcolumn=password crypt=1 where=expired=0
smtp account sufficient pam_mysql.so user=mailer passwd=alien db=mail
table=users usercolumn=login passwdcolumn=password crypt=1 where=expired=0


aliases.cf :
    
user = mailer
password = alien
dbname = mail
table = aliases
select_field = rcpt
where_field = alias
hosts = localhost

gids.cf:
  
user = mailer
password = alien
dbname = mail
table = users
select_field = 6
where_field = login
additional_conditions = and expired = '0'
hosts = localhost

transport.cf:

user = mailer
password = alien
dbname = mail
table = transport
select_field = transport
where_field = domain
hosts = localhost

uids.cf:

user = mailer
password = alien
dbname = mail
table = users
select_field = 125
where_field = login
additional_conditions = and expired = '0'
hosts = localhost

users.cf:

user = mailer
password = aliens
dbname = mail
table = users
select_field = maildir
where_field = login
additional_conditions = and expired = '0'
hosts = localhost


av124161# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
debug_peer_level = 2
default_privs = nobody
html_directory = no
local_recipient_maps = $virtual_mailbox_maps $virtual_maps $transport_maps
mail_owner = postfix
mail_spool_directory = /var/mail
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mynetworks = 192.168.0.0/24, 127.0.0.0/8
mynetworks_style = host
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relay_domains = $transport_maps
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_sasl_security_options = noanonymous
smtpd_banner = $myhostname MYLO
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_rbl_client      dynablock.wirehub.net, reject_rbl_client      blackholes.wirehub.net, reject_rbl_client      dnsbl.njabl.org
smtpd_sasl_auth_enable = yes
transport_maps = mysql:/usr/local/etc/postfix/sql/transport.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/usr/local/etc/postfix/sql/aliases.cf
virtual_gid_maps = mysql:/usr/local/etc/postfix/sql/gids.cf
virtual_mailbox_base = /var/mail/virtual
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/sql/users.cf
virtual_uid_maps = mysql:/usr/local/etc/postfix/sql/uids.cf


Вот… Очень прошу помощи. Форум читал ответа на чвой вопрос так и н енашел. В Postfix делаю первые шаги.

Заранее всем ответившим, огромное спасибо!


Содержание

Сообщения в этом обсуждении
"Postfix+cyrus-sasl2+saslauthd+mysql"
Отправлено ALex_hha , 11-Июн-08 13:33 
> Jun 11 12:37:25 av124161 postfix/trivial-rewrite[1089]: warning: connect to mysql server localhost: Access denied for user 'mailer'@'localhost' (using password: YES)

нет прав или неверный пароль. Проверь еще раз


"Postfix+cyrus-sasl2+saslauthd+mysql"
Отправлено beginner001 , 11-Июн-08 14:32 
>> Jun 11 12:37:25 av124161 postfix/trivial-rewrite[1089]: warning: connect to mysql server localhost: Access denied for user 'mailer'@'localhost' (using password: YES)
>
>нет прав или неверный пароль. Проверь еще раз

Да права и пароль - верные. Несколько раз проверял...
Вот пример... Логиньсь в mysql пользователем (он создан в MySQL)

av124161# mysql -u mailer -p
Enter password: Alien
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.22-rc-log FreeBSD port: mysql-server-5.1.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mail;
Database changed
mysql> select * from transport;
+-----------+-----------+---------+
| domain    | transport | comment |
+-----------+-----------+---------+
| preid.net | virtual   | NULL    |
+-----------+-----------+---------+
1 row in set (0.02 sec)

mysql> select * from users;
+-----------------+---------------+------------------+---------+-----------+----------+---------+
| login           | password      | maildir          | expired | antivirus | antispam | comment |
+-----------------+---------------+------------------+---------+-----------+----------+---------+
| kazak@preid.net | qV0fKBjqjKhf. | preid.net/kazak/ | 0       | 1         | 1        | NULL    |
+-----------------+---------------+------------------+---------+-----------+----------+---------+
1 row in set (0.02 sec)

mysql>


Кстатие, sasl, postfix и mysql работют...

av124161# ps ax | grep sasl
  708  ??  Is     0:00.00 /usr/local/sbin/saslauthd -a pam
  710  ??  I      0:00.00 /usr/local/sbin/saslauthd -a pam
  711  ??  I      0:00.00 /usr/local/sbin/saslauthd -a pam
  712  ??  I      0:00.00 /usr/local/sbin/saslauthd -a pam
  713  ??  I      0:00.00 /usr/local/sbin/saslauthd -a pam
1226  p0  RL+    0:00.00 grep sasl

av124161# ps ax | grep postfix
  921  ??  Is     0:00.03 /usr/local/libexec/postfix/master
1228  p0  S+     0:00.00 grep postfix

av124161# ps ax | grep mysql
  769 con- I      0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-f
  874 con- S      0:02.39 [mysqld]
1230  p0  R+     0:00.00 grep mysql

Уважаемые форумчане, пожалуйста подскажите что не так... (


"Postfix+cyrus-sasl2+saslauthd+mysql"
Отправлено Beginner001 , 11-Июн-08 14:36 
только preid.net и kazak@preid.net создал только что до этого было:

test.ru, test@test.ru


"Postfix+cyrus-sasl2+saslauthd+mysql"
Отправлено skgennady , 12-Июн-08 14:30 
uids.cf:

password = alien

users.cf:

password = aliens

Да пароль не правильно указан.