In /etc/postfix/sasl/smtpd.conf I have:
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_database: mail
sql_user: mailadmin
sql_passwd: secret
sql_select: SELECT password FROM users WHERE smtp_username = '%u'
sql_usessl: no
This is working if I place a plain text password in the password
field, but the database uses passwords stored with the MySQL ENCRYPT() function. Since the Query selects the password, rather than using the password in the where clause, how do I check that the user supplied password when ENCRYPT()ed matches the encrypted password in the database?
Is it possible to change the query to use ENCRYPT()ed passwords?