Complete Virtual Mail Server/PostgreSQL

PostgreSQL
PostgreSQL should have been installed from the previous chapters. Also a dedicated page for installing postfix exists, PostgreSQL. A really quick recap, in case Postfixadmin setup was skipped in the hopes of finding how to install PostgreSQL here.

After this start postgres and verify it came up normally.

When using webmin, it should be double checked that the settings for the postmaster PID file and host access config file are pointing towards the correct locations if they are not being picked up automatically.

Database Users
Postfixadmin has created a database for use already and is the owner of the database. All administrative editing should be done as this user. Postfix itself however also needs access to the database, though read-only access is enough.

The vmail User
The creation of the vmail user is not directly related to Postgresql. It's actually independent of the database backend. As a result, it was moved to its own page Linux user vmail

Granting access to the Database
Now that postfixadmin created a database, access to the postfix user needs to be realized.The database will be administerd and owned by the 'postfixadmin' user. The 'postfix' user will be used to read from the database by various services later. It is possible to copy these changes into either a file and then load them into postgres, or directly paste them into the postgres terminal.

To make sure postgres and the tables are working properly, connect to the database as the user postfix and verify.

Testing database access