/usr/lib/sasl2/smtpd.conf

Create this file as root, and insert these lines. Brackets indicate server-specific information.
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: PLAIN LOGIN
sql_engine: mysql
sql_user: mail
sql_passwd: <the mysql user mail's password>
sql_hostnames: <the mysqld hostname>
sql_database: mail
sql_select: SELECT password FROM accountuser WHERE username = '%u@%r' \
    OR (username ='%u' AND domain_name = '') 



Amin Astaneh 2007-02-28