* 'create_tables.pgsql'
- Removed unneeded sequences 'alias_id' and 'relocated_id'
- Removed unneeded column 'id' from table 'alias' and 'relocated'.
InstallationPrerequisitesYoushouldalreadyhaveinstalledandconfiguredPostfix,DovecotandPostgreSQL.YouhavetoinstallPythonandpyPgSQLtousetheVirtualMailManager.ConfiguringPostgreSQL*/etc/postgresql/8.2/main/pg_hba.conf# IPv4 local connections:hostmailsys+mailsys127.0.0.1/32md5# reload configuration/etc/init.d/postgresql-8.2force-reload*CreateaDBuserifnecessary:DBSuperuser:createuser-s-d-r-E-e-P$USERNAMEDBUser:createuser-d-E-e-P$USERNAME*CreateDatabaseanddbusersforPostfixandDovecotconnectingtoPostgreSQL:psqltemplate1# create databaseCREATEDATABASEmailsysENCODING'UTF8';# connect to the new database \cmailsys# import db structure \i/path/to/create_tables.pgsql# create users and groupCREATEUSERpostfixENCRYPTEDpassword'DB PASSWORD for Postfix';CREATEUSERdovecotENCRYPTEDpassword'DB PASSWORD for Dovecot';CREATEROLEmailsysWITHUSERpostfix,dovecot;# set permissionsGRANTSELECTONdovecot_password,dovecot_userTOdovecot;GRANTSELECTONpostfix_alias,postfix_maildir,postfix_relocated,postfix_uid,postfix_gid,postfix_transportTOpostfix;# leave psql \qCreatedirectoryforyourmailsmkdir/srv/mailcd/srv/mail/mkdir0123456789abcdefghijklmnopqrstuvwxyzchmod771/srv/mailchgrp-Rmail/srv/mailchmod751/srv/mail/*ConfiguringDovecot*/etc/dovecot/dovecot.conf# all your other settingsmail_location=maildir:~/Maildirmail_extra_groups=mailfirst_valid_uid=70000first_valid_gid=70000protocollda{postmaster_address=postmaster@domain.tld}authdefault{mechanisms=cram-md5passdbsql{args=/etc/dovecot/dovecot-sql.conf}userdbsql{args=/etc/dovecot/dovecot-sql.conf}user=nobodysocketlisten{master{path=/var/run/dovecot/auth-mastermode=0600}client{path=/var/spool/postfix/private/authmode=0660user=postfixgroup=postfix}}}*/etc/dovecot/dovecot-sql.confdriver=pgsqlconnect=host=localhostdbname=mailsysuser=dovecotpassword=$Dovecot_PASSdefault_pass_scheme=HMAC-MD5password_query=SELECT"user",passwordFROMdovecot_passwordWHERE"user"='%u'user_query=SELECThome,uid,gidFROMdovecot_userWHEREuserid='%u'ProvidearootSETUIDcopyofDovecot's deliver agent for Postfixmkdir-p/usr/local/lib/dovecotchmod700/usr/local/lib/dovecotchownnobody/usr/local/lib/dovecotcp/usr/lib/dovecot/deliver/usr/local/lib/dovecot/chmodu+s/usr/local/lib/dovecot/deliverStartorrestartDovecotConfiguringPostfix's master.cf# Add Dovecot's deliver agentdovecotunix-nn--pipeflags=DRhuuser=nobody:mailargv=/usr/local/lib/dovecot/deliver-f${sender}-d${user}@${nexthop}-n-m${extension}ConfiguringPostfix's main.cf# virtual domainsvirtual_mailbox_domains=pgsql:/etc/postfix/pgsql-transport.cfvirtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual_alias_maps.cftransport_maps=pgsql:/etc/postfix/pgsql-transport.cfvirtual_minimum_uid=70000virtual_uid_maps=pgsql:/etc/postfix/pgsql-virtual_uid_maps.cfvirtual_gid_maps=pgsql:/etc/postfix/pgsql-virtual_gid_maps.cfvirtual_mailbox_base=/virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual_mailbox_maps.cf# dovecot LDAdovecot_destination_recipient_limit=1virtual_transport=dovecot:# dovecot SASLsmtpd_sasl_type=dovecotsmtpd_sasl_path=private/authsmtpd_sasl_auth_enable=yessmtpd_sasl_local_domain=$myhostnamesmtpd_sasl_security_options=noplaintext,noanonymousInstallingtheVirtualMailManagerandconfiguretherestInstallingfromSVNorvmm-x.y.z.tar.bz2aftercheckingoutfromsvnorextractingthearchivechangeintothenewdirectoryandtype:./installeditallthepgsql-*.cffilesin/etc/postfixreloadpostfix# configure the Virtual Mail Managervmmconfigure# for help typevmmhelp