Mailman 2.1.10 on FreeBSD / Postfix

   
    Mailman is an excellent mailing list manager. It comes complete with the list manager and a CGI web frontend for admin and users.  I have used to for a number of years to handle very large and small mailing lists. Here is a quick rundown on installing and intergrating Mailman into postfix running on FreeBSD.

 

Installing the Port.

# cd /usr/ports/mail/mailman
# make install (Note: select Postfix only from the options list)
# make clean

    Mailman should now be installed into /usr/local/mailman

The Mailman CGI Scripts

    I am using apache 2.2 on this server so this documentation is greared towards that version. The CGI's will work under any version of apache but you will have to change the location of the files to meet your install.

    Copy over the icons.

# cd /usr/local/mailman/icons
# mkdir -p /usr/local/www/apache22/data/icons
# cp * /usr/local/www/apache22/data/icons/

    Create a config file for apache to read the mailman CGI setup directives from. If the new file is placed in /usr/local/etc/apache22/Includes them apache will automatically read this file on boot.
    NOTE: If you are using apache 1.3, then these directive would normally go into httpd.conf

    Create a new file called mailman.httpd.conf and place it in /usr/local/etc/apache22/Includes/ with the following information in it.

# Mailman CGI web frontend
<Directory "/usr/local/mailman/cgi-bin">
        Allow Override None
        Options None
        Order allow,deny
        Allow from all
</Directory>
<Directory "/usr/local/mailman/archives/public">
        Allow Override None
        Options None
        Order allow,deny
        Allow from all
</Directory>

ScriptAlias /mailman "/usr/local/mailman/cgi-bin"
Alias /pipermail "/usr/local/mailman/archives/public"

Integrating Mailman and Postfix

    Mailman des not work by default with the Postfix luser_relay directive turned on.  Postfix bu default has luser_relay already disabled but you should check your installation and make sure it was not enabled to support some thing else.

    Add the following directived to the Postfix main.cf file (located in /usr/local/etc/postfix on FreeBSD).

recipient_delimiter = +

    Note: Using the "+" as the delimiter works well with the VERP defaults built into mailman.

    Postfix returns a 450 error code for delivery to a non-existant local user. This just tells the remote mail server to delay and try again.  Changing this to a 550 (the default in FreeBSD) will return a permament error. In the Postfix main.cf file add the following:

unknown_local_recipient_reject_code = 550

    Mailman can update the alias file automatically when new lists are created or removed.  It does this by maintaining it's own alias file and then telling Postfix to read both the system alias file and the mailman one. Change the Postfix alias_maps directive in main.cf to include the mailman alias db as well.

alias_maps = hash:/etc/aliases,
                    hash:/usr/local/mailman/data/aliases

    Create the mailman alias file and add some final configurations settings to the mailman config file.

# cd /usr/local/mailman/Mailman
# echo "DEFAULT_EMAIL_HOST = 'epsb.net'" >> mm_cfg.py
# echo "SMTPHOST = 'localhost'" >> mm_cfg.py
# echo "MTA = 'Postfix'" >> mm_cfg.py
# /usr/local/mailman/bin/genaliases
# newaliases
# cd /usr/local/mailman/data
# chown mailman:mailman aliases*
# chmod g+w aliases*