User Tools

Site Tools


mailman

Mailman

Mailman - Emailing List Server

Mailman in this case was installed on a seperate server - lists.server.com. 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/mm_cfg.py
 DEFAULT_EMAIL_HOST = 'lists.server.com'
 DEFAULT_URL_HOST   = 'lists.server.com'

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>
 <Directory /var/lib/mailman/archives/public/>
    Options Indexes FollowSymlinks
    AllowOverride None
    Order allow,deny
    Allow from all
 </Directory>
 <Directory /usr/share/images/mailman/>
    AllowOverride None
    Order allow,deny
    Allow from all
 </Directory>
 <VirtualHost *:80>
 ServerName lists.server.com
 RedirectMatch ^/$ http://lists.server.com/cgi-bin/mailman/listinfo
 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
 </Directory>
 #All other lines are commented out.
 </VirtualHost>

Heading to the URL http://lists.server.com 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 lists.server.com. 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       88.198.111.111
 ;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 lists.server.com was correct were:

 dig -t mx lists.server.com
 
 nslookup
 > set type=mx
 > lists.server.com
 
 http://www.dnsstuff.com/
 http://www.dnsreport.com/  <nowiki>//</nowiki>very good.

If dns is correct, then apache should serve out http://lists.server.ie Also try sending emails to the following addresses:

 mailman at lists.server.com
 root at lists.server.com
and see if they get through. Fingers crossed and they should.

6. Login into Mailman Admin via Web

http://lists.server.com/cgi-bin/mailman/admin/mailman

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 server.com

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

 parent_domain_matches_subdomains =

This solved the problem, with the help of http://www.irbs.net/internet/postfix/0401/0705.html -)

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: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq03.003.htp


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
 mlist.owner.append('test@domain.net')
 #close and exit
 config_list -i mman name-of-list
Done.

There are a lot of other options available. See:

mailman.txt · Last modified: 2022/07/24 16:56 by admin