From Wiki

Jump to: navigation, search


Mailman - Emailing List Server

Mailman in this case was installed on a seperate server - This server has apache2, postfix and mailman running. To setup, see below:

1. Install Mailman & required Apps

apt-get install mailman
apt-get install postfix  //exim is default in debian.
apt-get install apache2 //if its not already installed.

Accept the languages you require, and complete the install. The install will instruct you to run "newlist mailman" to setup the main mailman account/list for moderating emails etc. etc. Before running "newlist mailman" configure mailman to use your URL/address.

2. Configure Mailman

vi /etc/mailman/

3. Setup initial Mailman list

newlist mailman

After specifying an email, full name and password, it will instruct you to insert the following lines into /etc/alias

## mailman mailing list
mailman:              "|/var/lib/mailman/mail/mailman post mailman"
mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
etc. etc. etc. etc. The full list will be outputted by the newlist mailman script run previously.
newaliases //regenerate aliases
/etc/init.d/mailman start
ps -eaf //to view all the mailman processes.

4. Configure Apache2 for Mailman

Mailman did not automatically configure apache2 for me. It did however place the relevant apache2.conf in /etc/mailman/apache2.conf. I took this file, edited it and placed it in /etc/apache2/sites-available/lists The main lines were:

ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/
<Directory /usr/lib/cgi-bin/mailman/>
   AllowOverride None
   Options ExecCGI
   AddHandler cgi-script .cgi
   Order allow,deny
   Allow from all
<Directory /var/lib/mailman/archives/public/>
   Options Indexes FollowSymlinks
   AllowOverride None
   Order allow,deny
   Allow from all
<Directory /usr/share/images/mailman/>
   AllowOverride None
   Order allow,deny
   Allow from all
<VirtualHost *:80>
RedirectMatch ^/$
ErrorLog /var/log/apache2/lists-error.log
CustomLog /var/log/apache2/lists-access.log combined
<Directory /var/lib/mailman/archives/>
    Options Indexes FollowSymLinks
    AllowOverride None
#All other lines are commented out.

Heading to the URL now worked fine, and I could browse and see the previously created mailman list -)

5. DNS Config for Mailman Server

There are two DNS entries for 1 is the mx (mail record) and the second is a A record. On the server running bind, the following additions were made:

;Main Domains

lists           A
;Main Sub Mail Domains
lists           MX      5       lists

Note: My initial zone file was incorrect! The Sub Main Domain will only work if all is configured correctly. Take a look at DNS_-_Bind9 to find out more on DNS and bind configuration. Make sure to restart bind. The tools used to check that the mx for was correct were:

dig -t mx

> set type=mx
>  //very good.

If dns is correct, then apache should serve out Also try sending emails to the following addresses:

mailman at
root at

and see if they get through. Fingers crossed and they should.

6. Login into Mailman Admin via Web

Login with the password initially used to run newlist mailman. It also should have been emailed to you. Approve the emails if they made it through, and then view the Archives to see if the email comes through.

7. Configure postfix on

This problem only affected postfix when sending emails from to When sending emails via postfix and smtpd, it picked up the mx/mail server as been instead of going off to So somehow postfix was not looking up subdomains or wouldnt send emails to subdomains. The line required to fix this in /etc/postfix/ was:

parent_domain_matches_subdomains =

This solved the problem, with the help of -)

8. Delete Posts from Mailman Archive

The location of mailman archives may change, but the method is the exact same.

cd /var/lib/mailman/archives
cd private

Private should be the source, and public is a folder with symbolic links coming out of private. Therefore if private is edited/changed, public will be too.

cd listname.mbox
vi listname.mbox
//delete the entry manually. Each message/entry begins with: From:.....  and ends with a blank line!
cd /var/lib/mailman/archives/private
mv listname listnameold  //move the old archives to an old directory, or delete them etc.
cd /var/lib/mailman/
./bin/arch listname    //rebuild and rearchive messages from the listname.mbox file edited earlier.

Go back into the archives via the web and all should be ok. More info on deleteing entries at:

More Information at (not really needed):

Admin Mailman via the command line

So I didn't know the mailman admin password for the front end, and I didn't want to change it to lock out the other admin. I wanted to add an Admin to a list.

vi mman
#close and exit
config_list -i mman name-of-list

Done. There are a lot of other options available. See:

Personal tools