Use courier-imap to auth for postfix with encrypted passowords in mysql
dkounal opened this issue · 1 comments
Hi,
I used your postfix howto but sasl sucks with encrypted passwords from mysql and postfix.admin.
Based on information in the following pages:
https://www.brandonchecketts.com/archives/configuring-postfix-sasl-to-authenticate-against-courier-authlib
https://www.thelazysysadmin.net/2009/08/cannot-connect-to-courier-authdaemond-no-such-file-or-directory/
https://askubuntu.com/questions/303120/how-folders-created-in-var-run-on-each-reboot
I used courier-imap to do the authentication, and it needs:
a) as my postfix is chroot we should move the socket of the courier-authdaemon (courier should be shutdown):
mkdir -p /var/spool/postfix/var/run/courier/authdaemon
rm -rf /run/courier/authdaemon
ln -s /var/spool/postfix/var/run/courier/authdaemon /run/courier/authdaemon
b) use the following contents in smatpd.conf in /etc/postfix/sasl
pwcheck_method: authdaemond
mech_list: PLAIN LOGIN
authdaemond_path: /var/run/courier/authdaemon/socket
c) as /run is recreated in each reboot, we should ask the system to recreate the symlink by adding the following line in file eg courier-authdaemon.conf in /etc/tmpfiles.d/:
L+ /run/courier/authdaemon - - - - /var/spool/postfix/var/run/courier/authdaemon
Postfix now can use courier-IMAP for authentication the smtp clients
Interesting. I will have to take a look at that.