Guide for installing Mailman with DirectAdmin

loretta

New member
Joined
Apr 4, 2008
Messages
4
Hello

I was wondering if someone could give me\tell me a guide for installation of mailman configured with directadmin? :)
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,335
Location
LT, EU
Install Mailman:
Code:
cd /usr/local/src
groupadd mailman
/usr/sbin/useradd -d /usr/local/mailman -s /bin/false -g mailman mailman
chown mailman:mailman /usr/local/mailman
chmod 02775 /usr/local/mailman
wget -O mailman-2.1.17.tgz http://ftp.gnu.org/gnu/mailman/mailman-2.1.17.tgz
tar xzf mailman-2.1.17.tgz
cd mailman-2.1.17
./configure --with-cgi-gid=mailman --prefix=/usr/local/mailman
make
make install
#Changes for suexec (fixing "error: directory is writable by others")
/usr/local/mailman/bin/check_perms -f
chmod 755 /usr/local/mailman/cgi-bin
chmod u-s,g-s /usr/local/mailman/cgi-bin/*
chmod 777 /usr/local/mailman/logs
chown -R mailman:mailman /usr/local/mailman
crontab -u mailman /usr/local/mailman/cron/crontab.in
cp -f /usr/local/mailman/scripts/mailman /etc/init.d/mailman
#Change master password
/usr/local/mailman/bin/mmsitepass
#Create a mailman list
/usr/local/mailman/bin/newlist -q -e hostname.com mailman mailman@hostname.com [B]password[/B]
#Apply template to the sitelist
/usr/local/mailman/bin/config_list -i /usr/local/mailman/data/sitelist.cfg mailman
Changes needed for exim.conf:
Before primary_hostname add:
Code:
# Home dir for your Mailman installation -- aka Mailman's prefix
# directory.
MAILMAN_HOME=/usr/local/mailman
MAILMAN_WRAP=MAILMAN_HOME/mail/mailman
Add mailman user to trusted_users list.

After begin routers add:
Code:
mailman_router:
driver = accept
require_files = MAILMAN_HOME/lists/$local_part/config.pck
local_part_suffix_optional
local_part_suffix = -bounces : -bounces+* : \
-confirm+* : -join : -leave : \
-owner : -request : -admin
transport = mailman_transport
After begin transports add:
Code:
mailman_transport:
driver = pipe
command = MAILMAN_WRAP \
'${if def:local_part_suffix \
{${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
{post}}' \
$local_part
current_directory = MAILMAN_HOME
home_directory = MAILMAN_HOME
user = mailman
group = mailman
Add the following lines to /etc/httpd/conf/extra/httpd-includes.conf file (however, it's recommended to create a virtual host for mailman):
Code:
Alias /mailman_images/ /usr/local/mailman/icons/
Alias /mailman/archives/ /usr/local/mailman/archives/public/
Alias /pipermail/ /usr/local/mailman/archives/public/

ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/

# Uncomment the following line, replacing www.example.com with your server's
# name, to redirect queries to /mailman to the listinfo page (recommended).

# RedirectMatch ^/mailman[/]*$ http://www.example.com/mailman/listinfo
Add email forwarders for your list (e.g. test):
Code:
test:              "|/usr/local/mailman/mail/mailman post test" 
test-admin:        "|/usr/local/mailman/mail/mailman admin test" 
test-bounces:      "|/usr/local/mailman/mail/mailman bounces test" 
test-confirm:      "|/usr/local/mailman/mail/mailman confirm test" 
test-join:         "|/usr/local/mailman/mail/mailman join test" 
test-leave:        "|/usr/local/mailman/mail/mailman leave test" 
test-owner:        "|/usr/local/mailman/mail/mailman owner test" 
test-request:      "|/usr/local/mailman/mail/mailman request test" 
test-subscribe:    "|/usr/local/mailman/mail/mailman subscribe test" 
test-unsubscribe:  "|/usr/local/mailman/mail/mailman unsubscribe test"
Now edit /usr/local/mailman/Mailman/mm_cfg.py and set:
Code:
    DEFAULT_EMAIL_HOST = 'mail.domain.com'
    DEFAULT_URL_HOST = 'www.domain.com'
    IMAGE_LOGOS = '/mailman_images/'
    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
    VIRTUAL_HOSTS = {'www.example.com': 'example.com',
                     'www.example2.com': 'example2.com'}

#Syntax is {virt ":" real "," virt ":" real}
Start mailman:
Code:
chmod 755 /etc/init.d/mailman
chkconfig --add mailman
/etc/init.d/mailman start
That's it, restart Exim and Apache :) Good luck!
 
Last edited:

tlchost

Verified User
Joined
Apr 4, 2007
Messages
381
Install it in /usr/lib/mailman. Changes needed for exim.conf:
Will this allow any user to have mailmain lists in his/her domain?

If so, is there a way to have a selection between majordomo and mailman in the control panel?

thanks
Thom
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,335
Location
LT, EU
tlchost, no it won't, only root will be able to do that. You should ask DA to include MailMan into DA interface :) (or you can write a 3rd party plugin)
 

tlchost

Verified User
Joined
Apr 4, 2007
Messages
381
tlchost, no it won't, only root will be able to do that. You should ask DA to include MailMan into DA interface :) (or you can write a 3rd party plugin)
Thanks.....I will keep it a big secret from my users....but I do plan to use it for myself. Can I specify the domain that will have the list?

I would hope it's added to DA....I have lost several accounts because they either use mailman, or simply don't like majordomo.

Thanks very much for posting the how to .
 

chatwizrd

Verified User
Joined
Jul 3, 2005
Messages
2,007
See if you can get this thread set with sticky topic. This has good info for many users.
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
Done. But perhaps I should move it to the How-To section instead?

Jeff
 

tlchost

Verified User
Joined
Apr 4, 2007
Messages
381
Done. But perhaps I should move it to the How-To section instead?

Jeff
You could, but for neophytes like myself...the how to might address things like:

Mailman docs say to run this command:

useradd -c''GNU Mailman'' -s /no/shell -d /no/home -g mailman mailman

On Centos5, the system gives back a list of options, which tells me the command isn't correct.

Perhaps someone can tell me the correct line for Centos?

Thanks
 

chatwizrd

Verified User
Joined
Jul 3, 2005
Messages
2,007
You could, but for neophytes like myself...the how to might address things like:

Mailman docs say to run this command:

useradd -c''GNU Mailman'' -s /no/shell -d /no/home -g mailman mailman

On Centos5, the system gives back a list of options, which tells me the command isn't correct.

Perhaps someone can tell me the correct line for Centos?

Thanks
The reason for the error is because they use " instead of ' if you change it to -c'GNU Mailman' it will be ok.
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,335
Location
LT, EU
Just updated my post :) Including Mailman installation and httpd.conf changes.
 

tlchost

Verified User
Joined
Apr 4, 2007
Messages
381
Adding Mailman Virtual Hosts

Adding Mailman Virtual Hosts version 0.9
(c)07-22-08 Thom LaCosta

A Mailman installation can provide mailing list service for all domains on
a server. At this time, the system administrator must perform certain
functions. Once these functions are accomplished, either the Systems
Administrator or the Site Administrator can finish the installation.

Mailman can be installed via the steps posted at
http://directadmin.com/forum/showthread.php?t=25596&highlight=mailman

A. Add mailman virtual host
At this time, only the system administrator can perform this function
Log in via SSH as admin or root
cd /usr/local/mailman/Mailman
Edit the file mm_cfg.py
At the end of the file, add the virtual host after these lines
#################################################
# Put YOUR site-specific settings below this line.
add_virtualhost( 'mailman.the_domain.you_add' )

restart mailman
service mailman restart

B. Add DNS Entry
This step must be performed by the System Administrator unless the Site
Administrator had been given access to DNS Management. Add two
entries via DNS Management as follows:

www.mailman A the_ip_that_the_domain_uses
mailman A the_ip_that_the_domain_uses

C. Add virtual Host Container to /etc/httpd/conf/httpd.conf
Sample

<VirtualHost 12.180.200.76:80>


ServerName www.mailman.virtual_domain
ServerAlias www.mailman.virtual_domain virtual.domain
ServerAdmin webmaster@tlchost.com
DocumentRoot /usr/local/mailman
ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/

UseCanonicalName OFF

User mailman
Group mailman
CustomLog /var/log/httpd/domains/mailman.virtual_domain.bytes bytes
CustomLog /var/log/httpd/domains/mailman.virtual_domain.log combined
ErrorLog /var/log/httpd/domains/mailman.virtual_domain.error.log

<Directory /usr/local/mailman/cgi-bin/>
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

Alias /pipermail/ /usr/local/mailman/archives/public/
<Directory /usr/local/mailman/archives/public>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Restart Apache
service httpd restart

D. Add aliases
Each new Mailman list requires aliases to be entered in /etc/aliases
Mailman will send a message to the list owner with the aliases to add
There are two ways to add the aliases for Mailman. One is to add them
via the control panel as forwarders. The other method is to simply add
the aliases via an ssh session and restart Exim when finished
service exim restart

Sample Alias File for list named new-list
new-list: "|/usr/local/mailman/mail/mailman post new-list"
new-list-admin: "|/usr/local/mailman/mail/mailman admin new-list"
new-list-bounces: "|/usr/local/mailman/mail/mailman bounces new-list"
new-list-confirm: "|/usr/local/mailman/mail/mailman confirm new-list"
new-list-join: "|/usr/local/mailman/mail/mailman join new-list"
new-list-leave: "|/usr/local/mailman/mail/mailman leave new-list"
new-list-owner: "|/usr/local/mailman/mail/mailman owner new-list"
new-list-request: "|/usr/local/mailman/mail/mailman request new-list"
new-list-subscribe: "|/usr/local/mailman/mail/mailman subscribe new-list"
new-list-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe new-list"

service exim restart

E. Creating List
The new list can be created via the web once the virtual host information
propagates.
One would browse to
www.mailman.the_ip_that_the_domain_uses/mailman/admin
select create a list and at
www.mailman.the_ip_that_the_domain_uses/mailman/create
create the list new-list, use the email of the list owner and select send
notification to list owner

The list may be created prior to propagation via ssh. If you're logged in
as root and create the lists,
cd /usr/local/mailman/lists/name_of_the_new_list and change ownership
and group of the files to mailman
chown mailman:mailman

Another method would be to su to mailman ( su mailman ), change to the
mailman directory cd /usr/local/mailman and issue the command bin/newlist
 

keefe007

Verified User
Joined
Dec 25, 2004
Messages
292
Is there any reason why directadmin doesn't migrate from majordomo to mailman? Majordomo hasn't been updated more than 8 years.
 

tlchost

Verified User
Joined
Apr 4, 2007
Messages
381
Is there any reason why directadmin doesn't migrate from majordomo to mailman? Majordomo hasn't been updated more than 8 years.
I would hope that DA adds mailman for virtual sites without removing MajorDomo...I have some users that will move away if MajorDomo disappears, and I now have some new users since I can offer mailman. Having both seems to be the way to go.
 

Peter Laws

Verified User
Joined
Sep 13, 2008
Messages
1,747
Location
London UK
# ./configure --with-cgi-gid=mailman
checking for --with-python... no
checking for python... /usr/bin/python
checking Python interpreter... /usr/bin/python
checking Python version... 2.4.4
checking that Python has a working distutils... configure: error:

***** Distutils is not available or is incomplete for /usr/bin/python
***** If you installed Python from RPM (or other package manager)
***** be sure to install the -devel package, or install Python
***** from source. See sec. 15.1 of the Installation Manual for
***** details
Er, what does this mean.......
 
Top