I try to config postfix smtp authentication by cyrus-sasl, but failed.
the content of /etc/postfix/sasl/smtpd.conf is as following:
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login cram-md5 digest-md5
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: openexchange
sql_passwd: secret
sql_database: open-xchange-db
sql_select: select userPassword from user
I do not how to config sql_select line. The user table of open-oxchange database open-xchange-db is like this:
and the login2user table is like:
I hope postfix authenticate can get data from user or login2user table.
Any suggersion are very appreciated.
the content of /etc/postfix/sasl/smtpd.conf is as following:
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login cram-md5 digest-md5
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: openexchange
sql_passwd: secret
sql_database: open-xchange-db
sql_select: select userPassword from user
I do not how to config sql_select line. The user table of open-oxchange database open-xchange-db is like this:
Code:
mysql> select userPassword, mail from user; +---------------+---------------------+ | userPassword | mail | +---------------+---------------------+ | Af.iibkNjIBY2 | [EMAIL="oxadmin@example.com"]oxadmin@example.com[/EMAIL] | | aiV0aJdZoITcs | [EMAIL="dqiu@35post.com"]dqiu@35post.com[/EMAIL] | | zIvuuyajsHETU | [EMAIL="sweng@35post.com"]sweng@35post.com[/EMAIL] | +---------------+---------------------+ 3 rows in set (0.00 sec) mysql> select * from user; +-----+----+------------+-----------+---------------------+------------+-------------+-------------------+------------------+------------+---------------+---------------+-----------+--------------+-----------+-----------+---------------+------------+ | cid | id | imapServer | imapLogin | mail | mailDomain | mailEnabled | preferredLanguage | shadowLastChange | smtpServer | timeZone | userPassword | contactId | passwordMech | uidNumber | gidNumber | homeDirectory | loginShell | +-----+----+------------+-----------+---------------------+------------+-------------+-------------------+------------------+------------+---------------+---------------+-----------+--------------+-----------+-----------+---------------+------------+ | 1 | 2 | localhost | NULL | [EMAIL="oxadmin@example.com"]oxadmin@example.com[/EMAIL] | NULL | 1 | en_US | -1 | localhost | Europe/Berlin | Af.iibkNjIBY2 | 1 | {CRYPT} | 5001 | 5000 | /tmp/foo | /bin/bash | | 1 | 24 | localhost | NULL | [EMAIL="dqiu@35post.com"]dqiu@35post.com[/EMAIL] | NULL | 1 | en_US | -1 | localhost | Asia/Shanghai | aiV0aJdZoITcs | 23 | {CRYPT} | 5023 | 5000 | /tmp/foo | /bin/bash | | 1 | 26 | localhost | NULL | [EMAIL="sweng@35post.com"]sweng@35post.com[/EMAIL] | NULL | 1 | en_US | -1 | localhost | Asia/Shanghai | zIvuuyajsHETU | 25 | {CRYPT} | 5025 | 5000 | /tmp/foo | /bin/bash | +-----+----+------------+-----------+---------------------+------------+-------------+-------------------+------------------+------------+---------------+---------------+-----------+--------------+---------
Code:
mysql> select * from login2user; +-----+----+---------+ | cid | id | uid | +-----+----+---------+ | 1 | 2 | oxadmin | | 1 | 24 | dqiu | | 1 | 26 | sweng | +-----+----+---------+ 3 rows in set (0.00 sec)
Any suggersion are very appreciated.
Comment