| 1 | = Setting up Postfix and Mailman on UTK server = |
| 2 | |
| 3 | == Postfix == |
| 4 | |
| 5 | |
| 6 | == Mailman == |
| 7 | The default mailman does not properly support multiple domains. On the UTK server we need to have separate instances of mailman for each domain so as to have different admins and main lists etc. |
| 8 | |
| 9 | Installed multiple copies of mailman using the script and instructions from [https://github.com/dpocock/mailmen] - a tarball of the code is attached to this page for posterity, and the instructions are as follows (copied from GitHub): |
| 10 | |
| 11 | {{{ |
| 12 | The aim of this script is to rapidly deploy multiple copies |
| 13 | of Mailman on a single host for virtual hosting. |
| 14 | |
| 15 | Mailman's design has very limited support for virtual hosting. |
| 16 | Various techniques exist using a shared installation of Mailman. |
| 17 | They have some particular limitations: |
| 18 | * all virtual lists appear on a single web page |
| 19 | * each list name must be globally unique across all domains |
| 20 | * a single shared domain for the "site list" |
| 21 | |
| 22 | The only effective way to purely achieve virtual hosting appears to |
| 23 | be installing multiple copies of Mailman, built from source, each |
| 24 | having its own directory tree. Each tree serves a single domain. |
| 25 | |
| 26 | This does not require multiple mail server instances. A single |
| 27 | mail server instance can be used, however, it is necessary to use |
| 28 | a hack to map virtual aliases to unique names in the aliases file. |
| 29 | The enclosed script "gen-mapped-aliases" automates this. |
| 30 | |
| 31 | == Setup procedure == |
| 32 | |
| 33 | 1. Install the basic Mailman 2.1.15 Debian package (to provide images and |
| 34 | other shared artifacts under /usr/share) |
| 35 | |
| 36 | 2. Set up a directory for the aliases files: |
| 37 | |
| 38 | mkdir /etc/mailmen |
| 39 | |
| 40 | and add them to /etc/postfix/main.cf (do not use line breaks): |
| 41 | |
| 42 | alias_maps = hash:/etc/aliases, |
| 43 | hash:/etc/mailmen/mapped-aliases |
| 44 | virtual_alias_maps = hash:/etc/postfix/virtual, |
| 45 | hash:/etc/mailmen/mapped-virtual |
| 46 | |
| 47 | 3. Get the sources |
| 48 | |
| 49 | apt-get source mailman |
| 50 | |
| 51 | or just download from the Mailman web site. If you are using |
| 52 | apt-get you may need to execute 'apt-get install dpkg-dev' before |
| 53 | the source download will work. |
| 54 | |
| 55 | 4. Build a custom instance for each domain, e.g.: |
| 56 | |
| 57 | fakeroot ./make-mailman mailman_2.1.15.orig.tar.gz lists.example.org |
| 58 | |
| 59 | If you are not on Debian, you may need to tweak "make-mailman", particularly |
| 60 | the environment variables at the beginning. If you get an error |
| 61 | message about Python Distutils, execute 'apt-get install python-dev |
| 62 | python-setuptools' |
| 63 | |
| 64 | You will find tarballs under /tmp for each of your domains, e.g. |
| 65 | /tmp/mailman-lists.example.org.tar.gz |
| 66 | |
| 67 | 5. As root, unpack the compiled tarball |
| 68 | |
| 69 | su - |
| 70 | cd / |
| 71 | tar xzf /tmp/mailman-lists.example.org.tar.gz |
| 72 | |
| 73 | 6. Enable the service for each domain: |
| 74 | |
| 75 | update-rc.d mailmen-lists-example-org defaults 20 2 3 4 5 . |
| 76 | |
| 77 | 7. Create the site list for each domain: |
| 78 | |
| 79 | /var/lib/mailmen/lists.example.org/bin/newlist mailman |
| 80 | |
| 81 | Ignore the instructions about modifying your aliases file, it is done |
| 82 | later. |
| 83 | |
| 84 | 8. Fix permissions (or archives won't work) - must be done after creating |
| 85 | any list! |
| 86 | |
| 87 | chown -R list /var/lib/mailmen/lists.simpleid.org/archives/private/* |
| 88 | |
| 89 | of to do all lists at once: |
| 90 | |
| 91 | chown -R list /var/lib/mailmen/*/archives/* |
| 92 | |
| 93 | 9. Update the aliases file for the mailer |
| 94 | |
| 95 | Run the enclosed gen-mapped-aliases script |
| 96 | |
| 97 | Manually check the results in /etc/mailmen |
| 98 | |
| 99 | NOTE: this script must be run every time a new list is created |
| 100 | with newlist or through the web. Consider running |
| 101 | it from cron. |
| 102 | |
| 103 | 10. Reload the mailer after adding any new virtual domain: |
| 104 | |
| 105 | service postfix reload |
| 106 | |
| 107 | 11. Add Mailman config to the Apache virtual host, note that you must |
| 108 | use the cgi-bin path corresponding to the virtual host. |
| 109 | |
| 110 | See the files apache2.conf and apache2-vhost.conf for |
| 111 | specific examples that are ready to use. |
| 112 | |
| 113 | Copyright (C) 2013 Daniel Pocock http://danielpocock.com |
| 114 | |
| 115 | Licensed under the GNU General Public License (GPL) v3.0 or later. |
| 116 | |
| 117 | Parts of these scripts adapted from the Mailman package in Debian |
| 118 | }}} |
| 119 | |
| 120 | |
| 121 | |
| 122 | |