Installation ============ Requirements ------------ - Python version 2.5+ - Django version 1.0+ (http://docs.djangoproject.com/en/dev/intro/install/#intro-install) How to install -------------- Download Mailng's tarball and extract it:: tar xzf mailng-.tar.gz Enter the mailng directory, create a settings.py file (you can use settings-sample.py as a model). Specify database relative informations. You must choose between mysql and postgresql, other types are not supported by major email projects like postfix or dovecot. Initialise the database by running the following command:: python manage.py syncdb Create the super admin account (just follow the procedure). Testing installation -------------------- As a typical Django application, Mailng can be tested using a simple web server. Just run this command to start it:: python manage.py runserver You will be able to play with mailng by looking at http://:8000/mailng/admin/. Tips to link Mailng with postfix -------------------------------- First, define following maps on your server (this should work with Postfix versions >= 2.2):: # /etc/postfix/sql-domains.cf user = password = dbname = query = SELECT name FROM admin_domain WHERE name='%s' AND enabled='1' # /etc/postfix/sql-mailboxes.cf user = password = dbname = query = SELECT path FROM admin_mailbox WHERE full_address = '%s' AND enabled = '1' # /etc/postfix/sql-aliases.cf user = password = dbname = query = SELECT t2.full_address FROM admin_alias AS t1, admin_mailbox AS t2 WHERE t1.full_address='%s' AND t1.mbox=t2.id AND t1.enabled='1' Then, use the following configuration in your /etc/postfix/main.cf file (this is one possible configuration):: # Stuff before mailbox_transport = virtual home_mailbox = Maildir/ maildrop_destination_recipient_limit = 1 virtual_minimum_uid = 500 virtual_gid_maps = static:500 virtual_uid_maps = static:500 virtual_mailbox_base = /var/vmail relay_domains = mysql:/etc/postfix/sql-domains.cf virtual_mailbox_domains = mysql:/etc/postfix/sql-domains.cf virtual_mailbox_maps = mysql:/etc/postfix/sql-mailboxes.cf virtual_alias_maps = mysql:/etc/postfix/sql-aliases.cf # Stuff after NB: Mailng only supports maildir format for now. Others will surely be added soon. Tips to link Mailng with dovecot -------------------------------- Edit your main Dovecot config file (/etc/dovecot/dovecot.conf) and put the following inside:: auth default { # ... stuff before passdb sql { # Path for SQL configuration file, see /etc/dovecot/dovecot-sql.conf for # example args = /etc/dovecot/dovecot-sql.conf } # ... stuff after } Be sure to activate only one backend inside your configuration (comment other ones). Then, edit your /etc/dovecot/dovecot-sql.conf and modify following lines:: driver = mysql connect = host= dbname= user= password= default_pass_scheme = MD5 password_query = SELECT address as user, password FROM admin_mailbox WHERE full_address = '%u' user_query = SELECT path as home, uid, gid FROM admin_mailbox WHERE full_address = '%u'