Loading

Postfix + MySQL + Courier IMAP on Ubuntu 16.04
The only true way
Part 3

 
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

Postfix + MySQL + Courier IMAP on Ubuntu 16.04
The only true way
Part 2

 

Postfix

Install Postfix:

apt-get install postfix postfix-mysql postfix-pcre

Create file /etc/postfix/mysql_domains.cf with the following content:

user = postfix_user
password = QWErty1
hosts = localhost
dbname = postfix
table = virtual_domains
select_field=domain
where_field=domain
additional_conditions = and enabled = 1

Read More

postfix

Postfix + MySQL + Courier IMAP on Ubuntu 16.04
The only true way
Part 1

A few days ago I needed to setup one more mail server. I thought Postfix + Courier IMAP + MySQL on Ubuntu 16.04 (Xenial Xerus) is a good choice. Actually I prefer CentOS but Ubuntu 16.04 has latest versions of packages and one of newest kernels so I decided to try it. There are lots of guides all over the internet but I was really shocked when I discovered tons of wrong ones. Thus I decided to write this step-by-step manual.

Read More