I found the problem, so here it is in case it would help anyone:
There's a configuration file for saslauthd
, mine is located in /etc/sysconfig/saslauthd
:
# Directory in which to place saslauthd's listening socket, pid file, and so
# on. This directory must already exist.
SOCKETDIR=/var/run/saslauthd
# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=pam
# Options sent to the saslauthd. If the MECH is other than "pam" uncomment the next line.
# DAEMONOPTS=--user saslauth
# OPTIONS="-c -r -m /var/spool/postfix/var/run/saslauthd"
OPTIONS="-c -m /var/run/saslauthd"
# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
# for the list of accepted flags.
FLAGS=
The OPTIONS
variable is supposed to contain the options passed to saslauthd
. It's missing -r
which does what exactly I was looking for. According to its documentation:
-r
Combine the realm with the login (with an ’@’ sign in between).
e.g. login: "foo" realm: "bar" will get passed as login:
"foo@bar". Note that the realm will still be passed, which may lead to unexpected behavior.
But my problem was not solved just by this change! It turned out that due to some bug in the /etc/init.d/saslauthd
script, even though the configuration file mentioned above is loaded, but it is not applied! The $OPTIONS
was never used!!!
Here's the original start section of /etc/init.d/saslauthd
script:
start() {
[ -x $path ] || exit 5
echo -n $"Starting $prog: "
daemon $DAEMONOPTS $path -m $SOCKETDIR -a $MECH $FLAGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
And this is how I amended it:
start() {
[ -x $path ] || exit 5
echo -n $"Starting $prog: "
daemon $DAEMONOPTS $path $OPTIONS -a $MECH $FLAGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
All done! Now the query contains the complete email address to check for the password.