Disable insecure IMAP server and restart secure IMAP SSL server. Also start and enable authlib service:
systemctl stop courier-imap systemctl disable courier-imap systemctl restart courier-imap-ssl systemctl enable courier-imap-ssl systemctl start courier-authdaemon systemctl enable courier-authdaemon
SASL way and PAM MySQL auth module for Postfix
Lots of manuals are based on PAM, libpammysql and SASL.
I’ve spent some time and used debugging tools like strace reading the docs and trying to find why my setup with PAM MySQL authentication module doesn’t work. The result is that it’s INCOMPATIBLE with Ubuntu 16.04 out of the box, at least right now (this is confirmed by few issues at Launchpad)
Fortunately we can use Courier Authdaemon not for IMAP only. Lets make it working for Postfix.
Your config file /etc/postfix/sasl/smtpd.conf should look like this:
pwcheck_method: authdaemond authdaemond_path: /var/run/courier/authdaemon/socket mech_list: plain login log_level: 9