May 062015
 

Screen 06-mei 0004

This guide shows how to install, configure and use Mailman on an Ubuntu server with ISPConfig.
Used versions:

  • Ubuntu 14.04.2 LTS
  • ISPConfig 3.0.5.4p5
  • Mailman 2.1.16

This guide assumes you have a running Postfix server with a working email address, e.g. “info@example.nl”.

If you installed Mailman already and it does not work (like mine..), first delete you current installation.

sudo -s
apt-get remove mailman
apt-get purge mailman
rm -r /var/lib/mailman
rm -r /var/log/mailman

Mailman installation

  1. Install Mailman
    apt-get install mailman
  2. Choose your languages, for example “en” and “nl”.
    Screen 06-mei 0002Click OK
    Screen 06-mei 0005
  3. Edit your Postfix configuration file:
    nano /etc/postfix/main.cf

    Add (or make sure they are there, ctrl+w in nano to find string):

    owner_request_special = no 
    virtual_maps = hash:/var/lib/mailman/data/virtual-mailman
    alias_maps = hash:/var/lib/mailman/data/aliases

    Safe and exit.

  4. Edit your Mailman configuration file:
    nano /etc/mailman/mm_cfg.py

    For the domain you want to use Mailman, add it to the POSTFIX_STYLE_VIRTUAL_DOMAINS. For more domains use the divider “,” e.g. [‘example1.com’, ‘example2.com’, ‘example3.com’]
    Go to the “Uncomment if you use Postfix virtual domains” section and add:

    #-------------------------------------------------------------
    # Uncomment if you use Postfix virtual domains (but not
    # postfix-to-mailman.py), but be sure to see
    # /usr/share/doc/mailman/README.Debian first.
    MTA='Postfix'
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example.nl']

    The next setting wil remove the cgi-bin from your Mailman url`s. It just looks so 1997. e.g. “http://www.example.nl/mailman/admin” instead of “http://www.example.nl/cgi-bin/mailman/admin”.
    Go to the “If you change these, you have to configure your http server” section and edit like this, so remove the “/cgi-bin“:

    #-------------------------------------------------------------
    # If you change these, you have to configure your http server
    # accordingly (Alias and ScriptAlias directives in most httpds)
    DEFAULT_URL_PATTERN = 'http://%s/mailman/'
    IMAGE_LOGOS = '/images/mailman/'

    Safe and exit.

  5. Make the new default list Mailman:
    newlist mailman

    choose an e-mail adress and password. Then give the command:

    newaliases
  6. Open the file aliases and verify its content:
    nano /etc/aliases

    It should look like:

    # mailman mailing list
    mailman: "|/var/lib/mailman/mail/mailman post mailman"
    mailman-admin: "|/var/lib/mailman/mail/mailman admin mailman"
    mailman-bounces: "|/var/lib/mailman/mail/mailman bounces mailman"
    mailman-confirm: "|/var/lib/mailman/mail/mailman confirm mailman"
    mailman-join: "|/var/lib/mailman/mail/mailman join mailman"
    mailman-leave: "|/var/lib/mailman/mail/mailman leave mailman"
    mailman-owner: "|/var/lib/mailman/mail/mailman owner mailman"
    mailman-request: "|/var/lib/mailman/mail/mailman request mailman"
    mailman-subscribe: "|/var/lib/mailman/mail/mailman subscribe mailman"
    mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"
  7. Edit the Mailman Apache config:
    nano /etc/mailman/apache.conf

    Uncomment the following line, remove the “#”:

    ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/

    Safe and exit.

  8. Activate the Mailman Apache config by making a symlink:
    ln -s /etc/mailman/apache.conf /etc/apache2/conf-available/mailman.conf
  9. Set and check permisions needed by Mailman, run:
    check_perms

    This will result in a few errors by default, fix it by running:

    chgrp -h list /var/lib/mailman/* 
    sudo -u root check_perms -f

    Run “check_perms” again, this should result in a:

    No problems found
  10. Check if the file “/var/lib/mailman/data/transport-mailman” exists, if not:
    touch /var/lib/mailman/data/transport-mailman
    postmap /var/lib/mailman/data/transport-mailman

    (When error in mail-log: ” fatal: open database /var/lib/mailman/data/transport-mailman.db: No such file or directory)

  11. Let`s finish up here en restart/start services:
    service apache2 restart && service postfix restart && service mailman start
  12. The webinterface is available after a few minutes, so first make a new list
    newlist everyone@example.nl

    Enter the email of the person running the list:

    info@example.nl

    Initial everyone password:

    [password]
    Hit enter to notify everyone owner

    Enter

  13. Now check if your Mailman web-frontend is working and go to the default list site:
    http://www.example.nl/mailman/listinfo/everyone
  14. Now try to login to the administrator page of the everyone list, use the password in step 10:http://www.example.nl/mailman/admin/everyone/2015-05-06_14-48-55
  15. Fix the e-mail address that is located at every page of Mailman:2015-05-06_15-59-18
    nano /usr/lib/mailman/Mailman/Cgi/admin.py

    change (CTRL+W in Nano -> mailman_owner = Utils.get_site_email())

    mailman_owner = Utils.get_site_email()

    to

    mailman_owner = 'info@example.nl'
  16. End.

 

Add a new list:

newlist everyone@example.nl

Enter the email of the person running the list:

info@example.nl

Initial everyone password:

[password]
Hit enter to notify everyone owner

Enter

Remove a list:

rmlist -a everyone

(-a Remove the list’s archives too)

 

Important files:
/usr/lib/mailman/Mailman/Cgi/admin.py
/etc/mailman/mm_cfg.py
/etc/mailman/apache.conf
Log files:
/var/log/mailman/


This guide will be updated soon with more information about how Mailman works. Please comment if you have any questions.

  3 Responses to “Mailman on Ubuntu with ISPConfig”

  1. Thanks for sharing! It is not easy to have mailman running.

    I had problems with Suexec and also a minor problem creating the list. virtual_to_transport.sh was missing. I’ve searched for it on the web, and created it.


    sudo vi /etc/mailman/virtual_to_transport.sh
    sudo chmod +x /etc/mailman/virtual_to_transport.sh

    virtual_to_transport.sh


    #!/bin/sh
    sed -r -e 's/(^[^#]\S+\s+).+$/\1local/' $1 > /var/lib/mailman/data/transport-mailman
    /usr/sbin/postmap /var/lib/mailman/data/transport-mailman

    Now it works 🙂

  2. thanks

    i have always a problem with debian/ispconfig3/mailman/postfix.

    i can create mailing list in ispconfig3
    this list is ok with web interface and all is ok.

    but i have a “loops back to myself” error send by postfix when the suscriber to a mailing list test to send a mail at the list.

    i have search with google but no soluce for this moment, do you have any idea for help me ?

    thx

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)