How to enable saslauthd and-testsaslauthd
By default, testsaslauthd test whether the authentication process works by invoking authentication onto the imap service, unless the -s service is passed along in the command-line. PAM configuration for the imap service is stored in /etc/pam.d/imap. However, if cyrus-imapd is not installed, the file /etc/pam.d/imap won’t exist and thus any try to use testsaslauthd against the default imap service will fail:
[root@sms ~]# adduser mailuser
[root@sms ~]# passwd mailuser
Changing password for user mailuser.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
# 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
[root@sms ~]# ls -l /etc/pam.d/imap
ls: cannot access /etc/pam.d/imap: No such file or directory
[root@sms ~]# testsaslauthd -u mailuser -p mailuser
0: NO "authentication failed"
[root@sms ~]# tail /var/log/messages
Apr 4 01:17:08 sms nagios: Auto-save of retention data completed successfully.
Apr 4 01:26:38 sms saslauthd[11618]: do_auth : auth failure: [user=mailuser] [service=imap] [realm=] [mech=pam] [reason=PAM auth error]
[root@sms ~]# testsaslauthd -s login -u mailuser -p 123@q56er
0: OK "Success."
Comments