* 'VirtualMailManager/Config.py'
- Config.configure(): Eliminated another UnicodeEncodeError
Thanks to samfisch for reporting this bug (also rev 110)
InstallationPrerequisitesYoushouldalreadyhaveinstalledandconfiguredPostfix,DovecotandPostgreSQL.YouhavetoinstallPythonandpyPgSQL*tousetheVirtualMailManager.IfyouwanttostorethepasswordsasPLAIN-MD4digestyouhavealsotoinstallpython-crypto<http://www.amk.ca/python/code/crypto.html>.*=http://pypgsql.sourceforge.net/(Debian:python-pgsql)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_gid,postfix_maildir,postfix_relocated,postfix_transport,postfix_uidTOpostfix;# leave psql \qCreatedirectoryforyourmailsmkdir/srv/mailcd/srv/mail/mkdir0123456789abcdefghijklmnopqrstuvwxyzchmod771/srv/mailchgrp-Rmail/srv/mailchmod751/srv/mail/*ConfiguringDovecot*/etc/dovecot/dovecot.conf# all your other settings#disable_plaintext_auth = nomail_location=maildir:~/Maildirmail_privileged_group=mailfirst_valid_uid=70000first_valid_gid=70000protocollda{postmaster_address=postmaster@YOUR-DOMAIN.TLD}authdefault{mechanisms=cram-md5loginplainpassdbsql{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=PLAINpassword_query=SELECT"user",passwordFROMdovecot_passwordWHERE"user"='%u'AND%Lsuser_query=SELECThome,uid,gid,'maildir:'||mailASmailFROMdovecot_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-virtual_mailbox_domains.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=yes# Keep smtpd_sasl_local_domain identical to Dovecot's auth_default_realm:# empty. Both are empty by default. Let it commented out.# Read more at: http://wiki.dovecot.org/Authentication/Mechanisms/DigestMD5#smtpd_sasl_local_domain =smtpd_sasl_security_options=noplaintext,noanonymous#smtpd_sasl_security_options = noanonymous#broken_sasl_auth_clients = yessmtpd_recipient_restrictions=permit_mynetworkspermit_sasl_authenticatedreject_unauth_destinationInstallingtheVirtualMailManagerandconfiguretherestInstallingfromSVNorvmm-x.y.z.tar.bz2aftercheckingoutfromsvnorextractingthearchivechangeintothenewdirectoryandtype:./install.sheditallthepgsql-*.cffilesin/etc/postfixreloadpostfix# configure the Virtual Mail Managervmmconfigure# for help typevmmhelp