Preamble

Assalamualaikum, Wr. Wb .. 

I got a job to migrating from Zimbra 8.6 to 8.7, and they are using Mailman as a Mailing List System. This guidance refer to my senior guidance https://imanudin.net/2015/12/26/how-to-integrating-zimbra-with-mailman-on-centos/. But, there are some different configuration in Zimbra 8.7. Let’s begin :

Information

So, i use this configuration :

OS : Ubuntu 14.04
IP Address : 192.168.100.125
Domain : dhenandi.com
Hostname : mail.dhenandi.com

Mailman Installation

Note : Make sure you have installed zimbra-apache.

  • Install package and dependencies, This is useful for compiling mailman
apt-get install python python-dev build-essential gcc -y
  • Install dnspython, this package required for compiling mailman too
cd /srv/
wget -c https://pypi.python.org/packages/source/d/dnspython/dnspython-1.12.0.zip
unzip dnspython-1.12.0.zip
cd dnspython-1.12.0
python setup.py install
  • Then, Install and compile mailman, you can download latest version of mailman at here: http://ftp.gnu.org/gnu/mailman/. This article is wrote using Mailman 2.1.23. You can run it with the following command:
cd /srv/
wget -c http://ftp.gnu.org/gnu/mailman/mailman-2.1.23.tgz
tar -zxvf mailman-2.1.23.tgz
cd mailman-2.1.23
groupadd mailman
useradd -c "GNU Mailman" -s /sbin/nologin -d /home/mailman -g mailman mailman
mkdir /usr/local/mailman
chgrp mailman /usr/local/mailman
chmod a+rx,g+ws /usr/local/mailman

./configure --prefix=/usr/local/mailman --with-cgi-gid=zimbra
make
make install
/usr/local/mailman/bin/check_perms -f
cd /usr/local/mailman/archives/
chown zimbra private
chmod o-x private
/usr/local/mailman/bin/check_perms -f

Make sure no error when you checking for permission, if you got a problem should be repair. If not, you can continue to the next step.

Configuring Mailman Apache

  • The next step is configuring Mailman Apache, edit /opt/zimbra/conf/httpd.conf. Beforehand, you need to backup it.
cp /opt/zimbra/conf/httpd.conf /opt/zimbra/conf/httpd.conf.back
vi /opt/zimbra/conf/httpd.conf
  • Add these script at the bottom of file :
Alias /webui /opt/zimbra/common/share/webui/ 
<Directory /opt/zimbra/common/share/webui/> 
AllowOverride AuthConfig 
Order Deny,Allow 
Allow from all 
</Directory> 
 
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
                                                                                                

Integrating Mailman with Zimbra

  • Then, you need to integrating Mailman with your Zimbra, edit file mm_cfg.py with the following command “vi /usr/local/mailman/Mailman/mm_cfg.py” and add these following script into bottom of file.
MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/opt/zimbra/common/sbin/postalias'
POSTFIX_MAP_CMD = '/opt/zimbra/common/sbin/postmap'
IMAGE_LOGOS = '/mmimages/'
DEFAULT_URL_PATTERN = 'http://%s:7780/mailman/'
POSTFIX_STYLE_VIRTUAL_DOMAINS = [ 'dhenandi.com' ]
DEFAULT_URL_HOST = 'mail.dhenandi.com'
DEFAULT_EMAIL_HOST = 'dhenandi.com'
VIRTUAL_HOSTS.clear()
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

Don’t forget to adjust the file according your data. You must change these line : POSTFIX_STYLE_VIRTUAL_DOMAINS, DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST.

  • Copy mmimages Mailman, run these following command  as root user.
cd /opt/zimbra/data/httpd/htdocs
mkdir mmimages
cp /usr/local/mailman/icons/* mmimages/
chown -R zimbra:zimbra mmimages/
su - zimbra -c "zmapachectl restart"

Setup Mailman

  • And then you need to setup mailman for the first time, run the following command as root user.
cd /usr/local/mailman
bin/newlist mailman admin@dhenandi.com
bin/mmsitepass -c list-creator-password
bin/config_list -i /usr/local/mailman/data/sitelist.cfg mailman
bin/genaliases
chown mailman:mailman /usr/local/mailman/data/aliases*
chown mailman:mailman /usr/local/mailman/data/virtual-mailman*
chmod 775 /usr/local/mailman/data/virtual-mailman.lmdb
chmod 775 /usr/local/mailman/data/aliases.lmdb

Note : Don’t forget to change admin@dhenandi.com to your admin milist and chage list-creator-password to your own password.

  • And then, setup crontab for milist. Run the following command :
cd /usr/local/mailman/cron
crontab -u mailman crontab.in
  • If you want the mailman services run while booting, run this following command:
cp /usr/local/mailman/scripts/mailman /etc/init.d/
update-rc.d mailman defaults
service mailman start
  • Finally, run the follwing command to completing Mailing List Configuration
su - zimbra
zmprov ms `zmhostname` zimbraMtaVirtualAliasMaps 'ldap:/opt/zimbra/conf/ldap-vam.cf,lmdb:/usr/local/mailman/data/virtual-mailman'
zmprov ms `zmhostname` zimbraMtaAliasMaps 'lmdb:/etc/aliases,lmdb:/usr/local/mailman/data/aliases'
zmprov ms `zmhostname` zimbraMtaMyDestination 'localhost mail.dhenandi.com' 
postconf -e allow_mail_to_commands="alias, forward" 
postconf -e allow_mail_to_files="alias, forward" 
zmcontrol restart

How to Test ?

Try to make your own mailing list :

cd /usr/local/mailman
bin/newlist milist-name admin-milist@dhenandi.com

If you prefer GUI you can access the following address to view, create, manage, or remove mailing list :

View : http://ipaddresszimbra:7780/mailman/listinfo
Createhttp://ipaddresszimbra:7780/mailman/create
Managehttp://ipaddresszimbra:7780/mailman/milist-name/admin

Okay, hope this article helpful, if you have a proble, don’t hesitate to give the comment below 🙂

Credits : Thanks to Nugi Abdiansyah and Ahmad Imanudin. You’re da Real MVP 😀


Dhenandi Putra

Hi, I'm dhenandi, Mac and openSUSE user. An office boy, typist, and man behind this blog. I also write on another blog https://dhenandi.web.id/ in Bahasa Indonesia.

9 Comments

Moh hasannuddin · October 2, 2017 at 3:42 pm

Pak saya ikuti tutorialnya, tetapi saat saya akses, 7780/mailman/create tidak keluar tampilan webnya, malah seperti save bin

    Dhenandi Putra · October 5, 2017 at 8:24 am

    apakah maksudnya jadi terdownload pak?

      Moh hasannuddin · October 5, 2017 at 8:30 am

      Iya pak, tapi Alhamdulillah sudah, ternyat loadmodule cgi belum diaktifkan?

        Dhenandi Putra · October 13, 2017 at 8:40 am

        dari artikel saya apakah ada yang salah pak? biar saya perbaiki

Biswajit · September 5, 2018 at 8:32 pm

Facing issue of web url (IP:7780/mailman/listinfo) is not opening but saving the file . Where is the issue ? is it something to do with cgi ? Can you please guide . TIA

    Dhenandi Putra · September 5, 2018 at 8:41 pm

    Hi,

    Thanks for visit,

    Sorry, i forget to update the article.

    This is because of cgi problem. the workaround is:

    1. Open and Edit /opt/zimbra/conf/httpd.conf
    2. Uncomment this line LoadModule cgid_module /opt/zimbra/common/lib/apache2/modules/mod_cgid.so
    3. Search for (ScriptSock), Uncomment and edit like this: Scriptsock /opt/zimbra/data/tmp/cgisock
    4. Restart apache su - zimbra -c "zmapachectl restart"

      Biswajit · September 5, 2018 at 9:02 pm

      Thanks it worked

      NDRYNT (@rendreznor) · September 11, 2019 at 11:35 am

      Terima kasih. Artikel ini menyelamatkan saya 🙂

Mohd. sadat qureshi · July 15, 2020 at 1:34 pm

Hello,
url = “http://mail.newsnation.in:7780/mailman/admindb/temp”

when i accept pending request and submit it then redirect page on “http://node.newsnation.in:7780/mailman/admindb/temp”
and give error

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.