Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Fedora 17 x86_64) - Page 3
9 Configure Saslauthd
Edit /etc/sasl2/smtpd.conf. It should look like this:
Then turn off Sendmail and start Postfix, saslauthd, and courier-authlib:
chmod 755 /var/spool/authdaemon
systemctl disable sendmail.service
On my test system, courier-authlib didn't start at boot; to fix this, I created /etc/rc.d/rc.local...
... and made it executable:
chmod 755 /etc/rc.d/rc.local
This will start courier-authlib at the end of the boot sequence.
10 Configure Courier
Now we have to tell Courier that it should authenticate against our MySQL database. First, edit /etc/authlib/authdaemonrc and change the value of authmodulelist so that it reads
Then edit /etc/authlib/authmysqlrc. It should look exactly like this (again, make sure to fill in the correct database details):
cp /etc/authlib/authmysqlrc /etc/authlib/authmysqlrc_orig
Then restart Courier:
systemctl enable courier-imap.service
When courier-imap is started for the first time, it automatically creates the certificate files /usr/lib/courier-imap/share/imapd.pem and /usr/lib/courier-imap/share/pop3d.pem from the /usr/lib/courier-imap/etc/imapd.cnf and /usr/lib/courier-imap/etc/pop3d.cnf files. Because the .cnf files contain the line CN=localhost, but our server is named server1.example.com, the certificates might cause problems when you use TLS connections. To solve this, we delete both certificates...
... and replace the CN=localhost lines in /usr/lib/courier-imap/etc/imapd.cnf and /usr/lib/courier-imap/etc/pop3d.cnf with CN=server1.example.com:
Then we recreate both certificates...
... and restart courier-authlib and courier-imap:
systemctl restart courier-authlib.service
telnet localhost pop3
you can see if your POP3 server is working correctly. It should give back +OK Hello there. (type quit to get back to the Linux shell):
[root@server1 share]# telnet localhost pop3
11 Modify /etc/aliases
Now we should open /etc/aliases. Make sure that postmaster points to root and root to your own username or your email address, e.g. like this:
or like this (if administrator is your own username):
Whenever you modify /etc/aliases, you must run
afterwards and restart Postfix:
systemctl restart postfix.service