programmatore java & php > consulente informatico
home / postcot / [ postgresql ] [ Login ]

Postcot + Postfix + Dovecot + Postgresql

postcot manages an email-address database for a generic email server based on virtual users

it requires:
- postgresql or mysql database
- postfix smtp server
- dovecot imap/pop3 server, best with dovecot with LDA
- php5 with pdo

1. create database

    su - postgres
    psql template1

2. create database table

    PGPASSWORD=postk012 psql -h localhost -U postcot postcotdb

3. configure apache and php

    apt-get install libapache2-mod-php5 php5-pgsql php5-pdo
    vi /etc/apache2/sites-available/
    vi /etc/apache2/sites-available/example

4. configure postcot and run

    open browser to
    login as / password

5. configure postfix

create vmail system user as owner of vmail directory (mailbox repository /home/vmail)
    groupadd -g 5000 vmail
    useradd -m -u 5000 -g 5000 -s /bin/false vmail
install postfix in bundle with dovecot (ubuntu)
    apt-get install dovecot-postfix
    apt-get install postfix-pgsql
    cd /etc/postfix
select all active domains
- pgsql: comment #host for fast unix socket
- mysql: use to avoid "postfix/trivial-rewrite[26321]: fatal: mysql:/etc/postfix/,lock|fold_fix): table lookup problem"

select all active email addresses
- %s addr %u user %d domain
- select 1 if transport is dovecot lda

select all active email aliases
configure postfix virtual users
- 5000 is vmail uid
- reject_unauth_destination reject unknown email recipient

enable dovecot local delivery (support quota and sieve... vacation)

6. configure dovecot

    apt-get install dovecot-pgsql
    cd /etc/dovecot
select all mailbox and aliases
    vi dovecot-sql.conf.ext
- see
    vi conf.d/auth-sql.conf.ext
    vi conf.d/01-mail-stack-delivery.conf
    vi conf.d/10-auth.conf
test configuration:
    dovecot -n

7. configure system

www-data (user group) can run disk usage command (du)

8. end

TreWiki - Aggiornamento pagina 2013-04-15 17:44:40

Informativa sulla privacy - P.IVA 0199 0700 229