Hi,

I'm setting up a mail server with postfix and dovecot. For SMTP, I want to
use saslauthd with a MySQL backend for which I installed the pam_mysql
library, I'm trying to configure it but there's no luck.

My table schema (users) has 3 columns:

    e-mail, password, quota

My /etc/pam.d/smtp configuration is:

auth    required   pam_mysql.so user=postfix passwd=... host=127.0.0.1
db=postfix table=users usercolumn=email passwdcolumn=password crypt=2
account sufficient pam_mysql.so user=postfix passwd=... host=127.0.0.1
db=postfix table=users usercolumn=email passwdcolumn=password crypt=2

However, saslauthd fails on authentication:

    Apr 17 21:20:48 X saslauthd[12714]: DEBUG: auth_pam: pam_authenticate
failed: User not known to the underlying authentication module
    Apr 17 21:20:48 X saslauthd[12714]:                 : auth failure:
[user=mike] [service=smtp] [realm=domain.com] [mech=pam] [reason=PAM aut
h error]

I can see that the problem relies on saslauthd using "mike" as the username
instead of "m...@domain.com", which is the actual record in the database
for the "email" column.

Is there a way to tell saslauthd to use the full username (including
domain) for the MySQL lookup?

My postfix configuration is like this:

smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous

My saslauthd configuration is like this:

START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

I'd be very grateful if someone could shed some light on it.

Thanks.

Reply via email to