# Mailman died, can't resurrect, please help.

## rajl

Mailman service now fails to start.  I've found the error messages in the logs, but I don't know what they are telling me, any help?

When mailman fails to load, the following error message is recorded in the error log:

 *Quote:*   

> 
> 
> Mar 02 10:40:01 2004 gate_news(1556): Traceback (most recent call last):
> 
> Mar 02 10:40:01 2004 gate_news(1556):   File "/usr/local/mailman/cron/gate_news", line 274, in ?
> ...

 

At first, I thought maybe the databases were corrupt, so I tried to regenerate them.  This is the error thrown when the command bin/genaliases is run.

 *Quote:*   

> 
> 
> Traceback (most recent call last):
> 
>   File "bin/genaliases", line 116, in ?
> ...

 

I don't know python, so I don't know quite what these messages are trying to tell me.  Any help fixing them would be greatly appreciated.[/quote]

----------

## Dr_Stein

I also updated mailman from portage recently and had a TON of problems. It moved to /usr/local/mailman, cron stuff isn't working, the web interface often gives errors.. 

It's been a mess. =/ 

Did you upgrade or do a fresh install?

----------

## rajl

This is an old install that had been stable for the last several months.  No upgrades done to it in the last few months.

----------

## rajl

Still looking for help please.

----------

## tealeaf

EDIT: I just noticed that I'd replied to a three-year-old post. I'm leaving it here in case any other poor fool manages to blindly upgrade Mailman and break everything.

 *rajl wrote:*   

> Still looking for help please.

 

Hi. It's kind of a stab in the dark, but have you upgraded anything at all? I believe that there have been a few Python upgrades recently as well as Mailman upgrades. If you've upgraded Python but not Mailman, it might be something that used to work with the old Python and is now retroactively broken. If nothing else, upgrading Mailman will give you security updates and the possibility that it will start working again.

My tentative advice is to upgrade Mailman. You need to be aware, though, that Mailman's install location has changed from /usr/local/mailman to /usr/lib/mailman. This means that you need to perform at least the following steps:

(I'm putting this here so that other people with problems might find it useful. I had an annoyingly long time getting my system working again. I'm running Mailman with sendmail, and didn't notice any instructions along with the install for how to get it running again. It's possible that there are clear and simple instructions that I've missed, but then perhaps other people missed them too!)

 Stop Mailman. (`/etc/init.d/mailman stop`)

 Create /usr/lib/mailman and change ownership and group to "mailman" (`mkdir -p /usr/lib/mailman && chown mailman:mailman /usr/lib/mailman`)

 Create /var/lib/mailman and ensure it has owner and group "root" (`mkdir -p /var/lib/mailman && chown root:root /var/lib/mailman`)

 Copy (don't move) /usr/local/mailman/* to /usr/lib/mailman/

 Copy (don't move) the following directories from /usr/local/mailman to /var/lib/mailman: archives data lists locks logs qfiles spam

 At this point you have put your existing Mailman setup into the new location, so an upgrade should work on top of it. Install the latest version of Mailman.

 Edit the "mailman" user to use the home directory /usr/lib/mailman. (`usermod -d /usr/lib/mailman mailman`)

 (Remembering that I'm using sendmail): Edit /etc/mail/aliases so that everywhere it currently says "/usr/local/mailman" it now says "/usr/lib/mailman". (In vim: ":%s/usr\/local\/mailman/usr\/lib\/mailman/g")

 Restart sendmail (which should generate new aliases).

 Just to be sure, remove any old lock files from /var/lib/mailman/locks (`rm /var/lib/mailman/locks/*`). This fixes the problem of having messages just pile up in your qfiles/in directory. This took me a while to find out and fix.

 Restart Mailman. (`/etc/init.d/mailman start`).

The above is messy and will leave you with old directories such as /usr/local/mailman and the old directories that have now been copied across to /var/lib/mailman. Delete those when you're absolutely sure that everything else is working. In fact, first of all you should move them somewhere out of the way and test that everything's working, then just archive them in a backup somewhere.  :Very Happy: 

I hope that this helps someone.  :Very Happy: 

----------

## chebe

I might not be the only someone around here, but this post REALLY helped me !!!

Thanks a lot !!!

For those using exim, and the "standard" mailman config for exim, there are a couple of lines to change :

```
MAILMAN_HOME=/var/lib/mailman

MAILMAN_WRAP=/usr/lib/mailman/mail/mailman

MAILMAN_USER=mailman

MAILMAN_GROUP=mailman
```

----------

## Scytale

If you happen to read this after you have upgraded Mailman and found out that everything's broken, resurrect your Mailman like this:

(Warning: This should work, however, I'm writing this after having fixed my Mailman, some of my memory may be wrong. Feel free to tell me if something is not quite right.

1. Edit /etc/passwd to set mailman's home directory to /usr/lib/mailman.

2. Stop Mailman: su - mailman -c bin/mailmanctl stop

3. Check if you need to modify your Apache config (/etc/apache2/modules.d/50_mailman.conf) to use the new path (I'm using a custom solution here, no idea if that step is needed). If yes, modify it and restart Apache.

4. Edit your MTA's config to use the new path. Remember that there's now /usr/lib/mailman and /var/lib/mailman!

5. Copy or move (depending on whether your backup is working...) the data directories that were left over in /usr/local/mailman, in particular archives, data, lists and logs. I used the following command: cd /usr/local/mailman && for X in archives/{private,public} data lists logs; do mv $X/* /var/lib/mailman/$X; done

6. Change the paths in the crontab: crontab -u mailman -e

7. Start Mailman: /etc/init.d/mailman restart (if this doesn't work, try /etc/init.d/mailman zap first).

8. Send a test mail to see whether it's really working. I had to send three and modify my config after each one until it really worked. ;)

----------

## tealeaf

 *Scytale wrote:*   

> 
> 
> 3. Check if you need to modify your Apache config (/etc/apache2/modules.d/50_mailman.conf) to use the new path (I'm using a custom solution here, no idea if that step is needed). If yes, modify it and restart Apache.
> 
> 5. Copy or move (depending on whether your backup is working...) the data directories that were left over in /usr/local/mailman, in particular archives, data, lists and logs. I used the following command: cd /usr/local/mailman && for X in archives/{private,public} data lists logs; do mv $X/* /var/lib/mailman/$X; done
> ...

 

Yes, step 3 is needed. I just found it myself and came back to check that this post was updated. Also, moving the archives is important. Thanks for your (far more concise!) version of this procedure.

One thing that I will add is this: really, really, really make sure that mailman has stopped. My processes didn't die with /etc/init.d/mailman stop, and they ended up filling up my server's disk with an 8gig qfile log! I would suggest not only /etc/init.d/mailman stop, but checking it with `ps -ef | grep [m]ailman` and, if necessary, killall -u mailman (or killall -9 -u mailman) until there aren't any processes left.

----------

## Pasketti

Thanks guys!

One more thing I had to do was edit the aliases file in /var/lib/mailman/data, and change the paths in there to /usr/lib/mailman

----------

## Scytale

 *Pasketti wrote:*   

> One more thing I had to do was edit the aliases file in /var/lib/mailman/data, and change the paths in there to /usr/lib/mailman

 

Thanks for pointing that out. For completeness: I don't have that file at all, it seems to be MTA specific whether you need it or not. (Although the README.gentoo in the Mailman docs suggest that the MTA aliases live in /etc/mail/aliases.)

----------

## Pasketti

 *Scytale wrote:*   

> Thanks for pointing that out. For completeness: I don't have that file at all, it seems to be MTA specific whether you need it or not. (Although the README.gentoo in the Mailman docs suggest that the MTA aliases live in /etc/mail/aliases.)

 

I use postfix.  It's set up to use /etc/mail/aliases for the normal aliases, and /var/lib/mailman/data/aliases for the various Mailman aliases.  It was /var/lib/mailman/data/aliases that I had to change.  But as you say, this is MTA-dependent.

I'm still a little irritated at whoever decided to fix something that wasn't broken...

----------

## Scytale

 *Pasketti wrote:*   

> I'm still a little irritated at whoever decided to fix something that wasn't broken...

 

Actually it was broken. /usr/local is supposed to be not touched by Portage at all.

----------

