1. The setup
  2. Create the vserver
    1. vserver configuration
  3. Install postfix and courier in the vserver
  4. Configure the vserver
  5. Configure Postfix
  6. Configure courier

Installing postfix and courier services into a vserver for syscp:

The setup

We setup postfix and courier services to sit in its own vserver. The other vservers communicate with it over SMTP. The vserver has one interface with the same IP as the host system (in this case: 69.90.134.159).

Create the vserver

... details at deb.riseup.net/vserver

vserver postfix build -m debootstrap --hostname postfix ...

vserver configuration

In /etc/vservers/postfix do the following:
# cd interfaces
# mkdir 0
# cd 0
# cat > ip
69.90.134.159
^D
# cat > prefix
25
^D
# touch nodev
Then start up the mysql vserver:
host# vserver postfix start

Install postfix and courier in the vserver

host# vserver postfix enter
mysql# apt-get install postfix postfix-mysql postfix-tls postfix-pcre libsasl2 libsasl2-modules libsasl2-modules-sql courier-authdaemon courier-authmysql courier-base courier-maildrop courier-pop

Configure the vserver

Make sure that /etc/resolv.conf has 127.0.0.3 at the top and that /etc/hosts has
127.0.0.2        mysql 

Configure Postfix

Follow the directions in the syscp administration Configuration for postfix, make the directories as they specify, but no need to make the debian-start script at the bottom. The different mysql- configuration files are needed.

The final postfix configuration we are using can be downloaded by grabbing postfix_raven.tar, you will need to edit many of the files to suit your setup (correct domain names, IPs, and specifically the passwords in mysql-virtual_alias_maps.cf, mysql-virtual_mailbox_domains.cf, mysql-virtual_mailbox_maps.cf, sasl/smtpd.conf).

NOTE: We have to setup the TLS stuff, need to setup the certs and uncomment the TLS options from main.cf

Configure courier

Follow the instructions located in the syscp administration Configuration section for setting up the courier configuration files and getting things setup.