ОС - Debian
cat /etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
#mech_list: DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: xxx
sql_user: xxx
sql_passwd: xxx
sql_database: xxx
sql_select: select xxx from xxx where email = '%u'
cat /etc/pam.d/smtp
auth required pam_mysql.so user=xxx passwd=xxx host=xxx db=xxx table=xxx usercolumn=xxx passwdcolumn=xxx crypt=1 md5=1
account sufficient pam_mysql.so user=xxx passwd=xxx host=xxx db=xxx table=xxx usercolumn=xxx passwdcolumn=xxx crypt=1 md5=1
если пароли в encrypt('xxx') - все ок, как только md5('xxx') - вот такие ошибки в логах cat /var/log/mail.log
Jun 20 10:07:04 proxy imapd-ssl: Connection, ip=[::ffff:xx.xx.xx.xx]
Jun 20 10:07:05 proxy authdaemond: received auth request, service=imap, authtype=login
Jun 20 10:07:05 proxy authdaemond: authmysql: trying this module
Jun 20 10:07:05 proxy authdaemond: authmysqllib: connected. Versions: header 50149, client 50161, server 50161
Jun 20 10:07:05 proxy authdaemond: SQL query: SELECT email, password, "", 5000, 5000, "/var/mail", CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/'), "", "", "" FROM users WHERE email = 'xxx@xxx.ru'
Jun 20 10:07:05 proxy authdaemond: supplied password 'xxx' does not match encrypted password '202cb962ac59075b964b07152d234b70'
Jun 20 10:07:05 proxy authdaemond: authmysql: REJECT - try next module
Jun 20 10:07:05 proxy authdaemond: FAIL, all modules rejected
Jun 20 10:07:05 proxy imapd-ssl: LOGIN FAILED, user=xxx@xxx.ru, ip=[::ffff:xx.xx.xx.xx]