Complete Virtual Mail Server/SMTP Authentication

Introducing
So far only localhost is allowed to send mail. Unfortunately postfix cannot work with courier-authlib directly. An intermediary solution exists however,. There are three ways cyrus-sasl can get authentication information. Either directly from the database, locally or remotely. A setup using this approach would look like this. courier-imap -> courier-authlib --\ +--> database postfix --> cyrus-sasl ---/

Making things only slightly more complex, cyrus-sasl can be used to communicate through courier-authlib and thus letting courier-authlib do the authentication.

courier-imap ---\ +-> courier-authlib -> database postfix -> cyrus-sasl --/

Ideally the last option would be used solution, as one authentication back-end would be used, courier-authlib. The cyrus-sasl plugin to talk to courier-authlib however will only work via a unix socket and thus if courier-authlib is not running on the same host as cyrus-sasl this would not work. The first approach should thus only be used if courier-authlib can not be used.

Installing cyrus-sasl
A key feature of cyrus-sasl that is required is the crypt useflag. It needs to be enabled or it will not work. Cyrus-sasl with the correct useflag should have been pulled in earlier whilst emerging postfix.

Configuring postfix with cyrus-sasl
Postfix needs a few options to tell it to use sasl in its main.cf. These are not mentioned in the config file so they should be added.

with authdaemond
gpasswd -a postfix mail