Mailman Guide

From Wiki
Revision as of 18:38, 23 November 2015 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Mailman error log is at /usr/local/cpanel/3rdparty/mailman/logs/error, this is the place to check for errors. You can also watch /var/log/exim_mainlog to see if mail is getting to the list.

Creating A New List

  • Login to cPanel, then click on the "Mail" icon.
  • Now click on the "Mailing Lists" link.
  • Click on "Add Mailing List" link.
  • Enter the name and password in their respective fields. Select the domain -the mail list will be used on- from the Domain drop-down list menu.
  • Click on the "Create" button.

Edit your mailing lists

  • Login to cPanel, then click on the "Mail" icon.
  • Click on "Mailing Lists" in the Mail Manager.
  • Click on "Edit" button next to the particular mailing list that you would like to edit.
  • Now log in to the list with your mailing list password. This will open up the Mailman Administration panel that you can use to adjust options.

Admin Tasks

All of the Mailman commands are located in the /usr/local/cpanel/3rdparty/mailman/bin directory, here is an overview of some basic tasks.

Subscribe to a list:

./bin/add_members -r -

This reads input from STDIN and adds the addresses to the list. Hit Ctl-D to stop.

Reset list password:

./change_pw -l listname -p newpassword

You can leave off the -p to use a random password.

Export subscriber list:

./list_members -o file.txt listname

This will export the subscriber addresses to a file which can then be imported into another list. This is useful for renaming a list or just to have a backup.

Export subscriber list with full names:

./list_members --fullnames <list_name>

Rebuild list archives:

./arch --wipe <listname> [<mbox>]

Where <mbox> is the path to a list's complete mbox archive.

For example:

./arch --wipe /usr/local/cpanel/3rdparty/mailman/archives/private/

This will read all of the messages in the file and rebuild the archives page.

This command will set the baseurl for mailman list links:

./withlist -l -r fix_url <listname> -u <urlbasehost/domainname>

Dump members for all lists on a specific domain. Replace DOMAIN and keep the _ Make sure to replace USER and DESTFOLDER as well. (DESTFOLDER must exist):

for list in $(ls /usr/local/cpanel/3rdparty/mailman/lists | grep -v '\./' | sed 's/\///' | grep _DOMAIN) ; do /usr/local/cpanel/3rdparty/mailman/bin/list_members $list -o /home/USER/DESTFOLDER/$list.txt; done

Fix DMARC issues caused by Mailman

By default Mailman sends mail "from" the original subscriber's address. This can cause issues with DMARC policies on multiple providers.

To fix:

Edit the Mailman Config file at /usr/local/cpanel/3rdparty/mailman/Mailman/

Add this to the bottom of the config, to make FROM munging the default on all NEW lists: DEFAULT_FROM_IS_LIST

Add this to the bottom of the config, to enable the new DMARC settings in Mailman: ALLOW_FROM_IS_LIST = Yes

On any list that needs this fix, go into Mailman Admin > General Options and look for the new setting that mentions DMARC. You will see 3 options: NO, MUNG FROM and WRAP MESSAGE (I am using the MUNG FROM option)

Troubleshooting Bug Issues

Bug in Mailman version 2.1.15

The most common problem seems to be when you try to login to manage the lists, it will present the bug error message. If you check the mailman log located here:

tail -300 /usr/local/cpanel/3rdparty/mailman/logs/error

It will show you an error like:

[Errno 21] Is a directory:

This means that the path exists and it shouldn't. There should only be public/listname or private/listname. To resolve this what you need to do is move the list in the error out of the way and then symlink it to the private list.

For example this should fix it:

mv /path/to/mailman/archives/public/$listname_domain.tld /root/$
ln -s /home/mailman/archives/private/$ /path/to/mailman/archives/public/$

After that attempt to login to manage the list. If problems persists check the error logs again.

Remember to move the one that mailman is complaining about.. it could either be public or private. After you verify that everything is working correctly with the list you can just remove /root/$

Login problems

If you are attempting to login to mailman and the page just continually loads over and over again without actually displaying the page to let you know that log was successful, the problem may be with the lock files. Simply remove the lock files to resolve the issue.

Check here for files that will end in $listname.lock


Keep in mind that you shouldn't actually be removing anything else from this directory.

Bug in Mailman 2.1.11.cp3

Customer created a list, then tries to modify the list and sees this error:

Bug in Mailman 2.1.11.cp3

We're sorry, we hit a bug!

Please inform the webmaster for this site of this problem. Printing of traceback and other system information has been explicitly inhibited, but the webmaster can find this information in the Mailman error logs.

To see the errors printed on this page edit:

/usr/local/cpanel/3rdparty/mailman/scripts/driver and set stealth mode=0

Sometimes python-devel RPM package was not installed:

yum install python-devel

Run these scripts in order to fix:

For reinstalling newer versions run
/usr/local/cpanel/bin/mailman-install --force

Some tactics outlined at were helpful in this problem:

chmod 02775 -R /usr/local/cpanel/3rdparty/mailman/

Emails bouncing, exim_mainlog showing mailman_virtual_transport: Child process of mailman_virtual_transport transport returned 2 from command: /usr/local/cpanel/3rdparty/mailman/mail/mailman

This can happen if the reinstallmailman scrip failed because patch is missing. Do

yum install patch

This should alleviate the issue.

If this fails to fix the issue, you may be falling prey to cpanel not having patches downloaded correctly. This can be fixed with the following and running the re-installation again.

 /scripts/upcp --force

Mailing list pulled from the wrong server

Mailman reports that the list is trying to be pulled from login and do a grep in the mailman directory. in this example i will use our shared servers.

cd /usr/local/cpanel/3rdparty/mailman
grep -R * > list.txt

Now cat that list - the archives

cat list.txt | grep -v archive

Should give you similar results of whats below, the mailman config that contains the offending url.

archive Binary file lists/ matches
Binary file lists/ matches

now make a backup of the config.pck and edit it.

cp config.pck config.pck.lwback
sed -i -e 's/host/host2/g' config.pck

this will change host to host2. Next login to mailman to see if the problem is fixed. This should fix the problem of mailman going to the wrong server.

Mailman Python Error

If Mailman can't be restarted and the reinstall script shows an error that looks similar to below you will need to update the system's python install.

checking Python version... /usr/local/bin/python2.4: error while loading shared libraries: cannot open shared object file: No such file or directory
cat: conftest.out: No such file or directory
configure: error:
***** /usr/local/bin/python2.4 is too old (or broken)
***** Python 2.4 or newer is required
warn [mailman-install] Could not find /usr/local/cpanel/src/3rdparty/gpl/mailman-2.1.14-1/src/Makefile
gmake: *** No targets specified and no makefile found.  Stop.
gmake: *** No rule to make target `install'.  Stop.

This means that either Python2.4 is broken or out of date. To fix this check which Python is being used.

which python

Do not delete the python this displays, it's dirty and will break CPanel.

Now backup Python2.4.

mv /usr/local/lib/python2.4 /root/libpython2.4bak
mv /usr/local/bin/python2.4 /root/binpython2.4bak

And reinstall it.

cd /usr/local/src
tar -xvzf Python-2.4.6.tgz
cd Python-2.4.6/
make install

Now clear your cache and log into WHM to make sure you didn't break CPanel, if it's good also run these:

python -V
yum update

If both of those work then try to reinstall Mailman again.

*For reinstalling newer versions run*
/usr/local/cpanel/bin/mailman-install --force

Assuming all went well, get rid of the backups.

rm -rf /root/libpython2.4bak
rm -rf /root/binpython2.4bak

If you still run into problems hit the Wiki harder, then Google moar, and if all that fails ask Escalations.

Disable Mailman

1) You can disable Mailman from

WHM >> Tweak Settings >> Mail


/usr/local/cpanel/3rdparty/mailman/bin/mailmanctl stop

2) Remove OR comment the following lines in the Apache configuration file and restart the httpd service

Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/

note: As we all know, CPanel doesn't like it when you mess with the apache config, so here is a method of disabling the web interface for mailman that won't get reverted if httpd.conf gets rebuilt. Just add this to the pre_virtualhost_include in WHM, under Apache Configuration:

<DirectoryMatch /mailman/>
  Order Allow,Deny
  Deny from all
<DirectoryMatch /pipermail/>
  Order Allow,Deny
  Deny from all

Web Interface

You can get to any Mailman list admin area on any cPanel server by going to:

[server name] + [/mailman/admin/] + [listname]

[servername] can also be any installed main account domain on cPanel, for any list, regardless of who that mailing list belongs to. This URL is standard across every cPanel server with Mailman unless someone manually changes it, and this is a very basic piece of information regarding a cPanel servers and Mailman.