May 11

How to install zimbra + mailman on ubuntu

mailman, Ubuntu Comments Off on How to install zimbra + mailman on ubuntu

I assume you have install zimbra on your ubuntu server, if not you may follow step by step zimbra installation on http://prigad.com/?p=565 On this tutorial we will try to install mailing list mailman integrated with zimbra on ubuntu.

Okay without further let’s begin the installation

– Download mailman sourcecode, you can find it on http://www.gnu.org/software/mailman/download.html

wget http://downloads.sourceforge.net/project/mailman/Mailman%202.1%20%28stable%29/2.1.12/mailman-2.1.12.tgz

– extract it
tar xvfz mailman-2.1.12.tgz

– create folder , user and group
# As root
groupadd mailman
useradd -c”GNU Mailman” -s /sbin/nologin -d /no/home -g mailman mailman
cd /usr/local
mkdir mailman
chgrp mailman mailman
chmod a+rx,g+ws mailman

make install
# following is required only if you are using Zimbra’s httpd
cd /usr/local/mailman/archives
chown zimbra private
chmod o-x private
# Check your installation
/usr/local/mailman/bin/check_perms -f

– configure
./configure –with-cgi-gid=zimbra

Now setup the web server. Add following lines at the end of /opt/zimbra/conf/httpd.conf

Code:

#
#  httpd configuration settings for use with mailman.
#

ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
<Directory /usr/local/mailman/cgi-bin/>
AllowOverride None
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 None
Order allow,deny
Allow from all
# Only if you have internationalized archives
AddDefaultCharset Off
</Directory>

# 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

Now copy mailman icons and then restart apache.
Code:

# As User ‘zimbra’
cd /opt/zimbra/httpd/htdocs
mkdir mmimages
cp /usr/local/mailman/icons/* mmimages/
zmapachectl stop
zmapachectl start

Now change postfix configuration.
Add/Modify /opt/zimbra/postfix/conf/main.cf so that following varibles are set as shown.
Code:

but first you need to stop the zimbra first
# /etc/init.d/zimbra stop

virtual_alias_maps = ldap:/opt/zimbra/conf/ldap-vam.cf,hash:/usr/local/mailman/data/virtual-mailman
alias_maps = hash:/etc/aliases,hash:/usr/local/mailman/data/aliases

then edit the /opt/zimbra/conf/zmmta.cf and remove the lines where these variables are otherwise those lines will be deleted when zimbra-postfix will be restarted.

edit and remove
mydestination
virtual_alias_maps
alias_maps
mynetworks

Add following lines at the end of /usr/local/mailman/Mailman/mm_cfg.py file.
Code:

MTA = ‘Postfix’
POSTFIX_ALIAS_CMD = ‘/opt/zimbra/postfix/sbin/postalias’
POSTFIX_MAP_CMD = ‘/opt/zimbra/postfix/sbin/postmap’
IMAGE_LOGOS = ‘/mmimages/’
DEFAULT_URL_PATTERN = ‘http://%s:7780/mailman/’
POSTFIX_STYLE_VIRTUAL_DOMAINS = [ ‘virtual-domain1.com’, ‘virtual-domain2.com’ ]

on mail.test.org
MTA = ‘Postfix’
POSTFIX_ALIAS_CMD = ‘/opt/zimbra/postfix/sbin/postalias’
POSTFIX_MAP_CMD = ‘/opt/zimbra/postfix/sbin/postmap’
IMAGE_LOGOS = ‘/mmimages/’
DEFAULT_URL_PATTERN = ‘http://%s:7780/mailman/’
POSTFIX_STYLE_VIRTUAL_DOMAINS = [ ‘test.org’ ]
#add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
add_virtualhost(‘mail.test.org’,’test.org’)

then start the zimbra
# /etc/init.d/zimbra start

In the last variable, you need to list all your virtual mailbox domains for which you want to add mailing lists. Remember you should ONLY list your virtual domains here, not your local domain for which postfix delivers mail locally.

Now add your first list on virtual domain.
Code:

# As root
# first add a sitewide list called mailman, this is mandatory
cd /usr/local/mailman
bin/newlist mailman
bin/config_list -i data/sitelist.cfg mailman

bin/newlist –emailhost=virtual-domain1.com –urlhost=<your zimbra host> <listname> <admin-email-address> <admin-password>

# This is just to make sure that aliases and virtual-mailman files get generated. Until you add a virtual-domain based list, virtual-mailman won’t be generated.

/usr/local/mailman/bin/genaliases
# aliases and virtual-mailman must be owned by mailman.

chown mailman:mailman /usr/local/mailman/data/aliases*
chown mailman:mailman /usr/local/mailman/data/virtual-mailman*

# setup mailman cron
cd /usr/local/mailman/cron
crontab -u mailman crontab.in

# setup daemon
cp /usr/local/mailman/scripts/mailman /etc/init.d
chkconfig –add mailman

Now your should be able to visit http://<zimbra host>:7780/mailman/listinfo and browse/create new lists etc. And of course you can always use mailman’s command line utilities for list maintainance.

######### How to delete mailing list

1. Delete the list and KEEP the list archives:
$ cd /usr/local/mailman/bin/
$ sudo ./rmlist listname

2. Delete list and DELETE all list archives:

sudo ./rmlist -a listname

– Download mailman sourcecode, you can find it on http://www.gnu.org/software/mailman/download.html

wget http://downloads.sourceforge.net/project/mailman/Mailman%202.1%20%28stable%29/2.1.12/mailman-2.1.12.tgz

– extract it
tar xvfz mailman-2.1.12.tgz

– create folder , user and group
# As root
groupadd mailman
useradd -c”GNU Mailman” -s /sbin/nologin -d /no/home -g mailman mailman
cd /usr/local
mkdir mailman
chgrp mailman mailman
chmod a+rx,g+ws mailman

make install
# following is required only if you are using Zimbra’s httpd
cd /usr/local/mailman/archives
chown zimbra private
chmod o-x private
# Check your installation
/usr/local/mailman/bin/check_perms -f

– configure
./configure –with-cgi-gid=zimbra

Now setup the web server. Add following lines at the end of /opt/zimbra/conf/httpd.conf

Code:

#
#  httpd configuration settings for use with mailman.
#

ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
<Directory /usr/local/mailman/cgi-bin/>
AllowOverride None
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 None
Order allow,deny
Allow from all
# Only if you have internationalized archives
AddDefaultCharset Off
</Directory>

# 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

Now copy mailman icons and then restart apache.
Code:

# As User ‘zimbra’
cd /opt/zimbra/httpd/htdocs
mkdir mmimages
cp /usr/local/mailman/icons/* mmimages/
zmapachectl stop
zmapachectl start

Now change postfix configuration.
Add/Modify /opt/zimbra/postfix/conf/main.cf so that following varibles are set as shown.
Code:

but first you need to stop the zimbra first
# /etc/init.d/zimbra stop

virtual_alias_maps = ldap:/opt/zimbra/conf/ldap-vam.cf,hash:/usr/local/mailman/data/virtual-mailman
alias_maps = hash:/etc/aliases,hash:/usr/local/mailman/data/aliases

then edit the /opt/zimbra/conf/zmmta.cf and remove the lines where these variables are otherwise those lines will be deleted when zimbra-postfix will be restarted.

edit and remove
mydestination
virtual_alias_maps
alias_maps
mynetworks

Add following lines at the end of /usr/local/mailman/Mailman/mm_cfg.py file.
Code:

MTA = ‘Postfix’
POSTFIX_ALIAS_CMD = ‘/opt/zimbra/postfix/sbin/postalias’
POSTFIX_MAP_CMD = ‘/opt/zimbra/postfix/sbin/postmap’
IMAGE_LOGOS = ‘/mmimages/’
DEFAULT_URL_PATTERN = ‘http://%s:7780/mailman/’
POSTFIX_STYLE_VIRTUAL_DOMAINS = [ ‘virtual-domain1.com’, ‘virtual-domain2.com’ ]

on mail.binusian.org
MTA = ‘Postfix’
POSTFIX_ALIAS_CMD = ‘/opt/zimbra/postfix/sbin/postalias’
POSTFIX_MAP_CMD = ‘/opt/zimbra/postfix/sbin/postmap’
IMAGE_LOGOS = ‘/mmimages/’
DEFAULT_URL_PATTERN = ‘http://%s:7780/mailman/’
POSTFIX_STYLE_VIRTUAL_DOMAINS = [ ‘binusian.org’ ]
#add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
add_virtualhost(‘mail.binusian.org’,’binusian.org’)

then start the zimbra
# /etc/init.d/zimbra start

In the last variable, you need to list all your virtual mailbox domains for which you want to add mailing lists. Remember you should ONLY list your virtual domains here, not your local domain for which postfix delivers mail locally.

Now add your first list on virtual domain.
Code:

# As root
# first add a sitewide list called mailman, this is mandatory
cd /usr/local/mailman
bin/newlist mailman
bin/config_list -i data/sitelist.cfg mailman

bin/newlist –emailhost=virtual-domain1.com –urlhost=<your zimbra host> <listname> <admin-email-address> <admin-password>

# This is just to make sure that aliases and virtual-mailman files get generated. Until you add a virtual-domain based list, virtual-mailman won’t be generated.

/usr/local/mailman/bin/genaliases
# aliases and virtual-mailman must be owned by mailman.

chown mailman:mailman /usr/local/mailman/data/aliases*
chown mailman:mailman /usr/local/mailman/data/virtual-mailman*

# setup mailman cron
cd /usr/local/mailman/cron
crontab -u mailman crontab.in

# setup daemon
cp /usr/local/mailman/scripts/mailman /etc/init.d
chkconfig –add mailman

Now your should be able to visit http://<zimbra host>:7780/mailman/listinfo and browse/create new lists etc. And of course you can always use mailman’s command line utilities for list maintainance.

Hope this helps.
Reply With Quote

######### How to delte mailing list

cd /usr/local/mailman/bin/
./rmlist -a listname

./rmlist -a cahpct

1. Delete the list and KEEP the list archives:

$ sudo ./rmlist listname

2. Delete list and DELETE all list archives:

sudo ./rmlist -a listname