Remove Mailman’s Archive – Reduce Account Disk Space

September 24th, 2012 admin Location: Raleigh, NC, Topic: Web Design | Digital Media

Sometimes you may run into a situation where a Mailman mailing list is keeping either public or private archives of your messages and therefore you’ll eventually run into an interesting problem:

Problem:

Because Mailman has been keeping an archive of every message, image and email content that has been used in the list, that means that eventually that archive will be enormous, or at least big enough to make you want to delete it. How do you go about doing that? You can spend hours trying to find the right answer in Google and testing what works and what doesn’t or you can bypass all that and jump into the answer! Here it is:


[private]

The Solution:

After many attempts and of course my fair share of searching Google for how to remove the archives of the mailing list I thought of writing this guide in order to reduce the time for any of you attempting this. Here it is:

In order to accomplish the removal of your archives, you’ll have to do a combination of GUI things and Terminal (BASH) things. Why? It’s just the easiest way that I know to getting it done.

So let’s start with the GUI part.

Log into the administrator interface for the mailing list that you want to remove archives from and do the following:
1. Click the Archiving Options Link.

 

2. Define the options to “No archiving” (see photo attached).

3. Set to private the second option

4. Click Save changes.

 

The Terminal (BASH) Commands:

Ok, so the GUI part is now done, now all you have to do is log into your server via SSH and type the following commands:

cd ~mailman
cd ..
cd archives/private/yourlist_yourdomain.com.mbox/
mv yourlist_yourdomain.com.mbox remove.archives
touch yourlist_yourdomain.com.mbox
tar -czvf a-nice-name.tar.gz remove.archives

What this part of the code did is the following:

  • First change the directory to the mailman directory (you may have to go up a directory to find all the right files as we did here in the second line).
  • Then we change directory to the archives/private/your-list.mbox/ folder
  • Next, we move the .mbox file (not the directory) to another random name.
  • This next step is critical – now create a new file with the old name – as shown here you can use the command “touch” to create that new file.
  • Then we create a tar file of the archive (just in case you feel like you want to be safe).
  • So far so good.
cd ../../../bin/
./arch --wipe yourlist_yourdomain.com

# Now you can download the archive tar file to your local machine if you want for Storage...
scp username@123.123.123.123:/location/of/your/file/a-nice-name.tar.gz /
rm remove.archives
rm a-nice-name.tar.gz 
/scripts/update_mailman_cache

This part of the code allows us to:

  • First change directory to the bin folder withing mailman.
  • Then we execute the command called arch to recreate the archive of the list (but since we now moved -mv- our file name to another one, then it gets recreated from scratch.
  • Next, of course is downloading the tar file to our local computer for storage. Then make sure to remove all those files so that they don’t take any more space in your hosting account (that’s why you are doing all this right?)
  • That’s it, finally, go ahead and run the update_mailman_cache command to clear the cache of space being used by the archives in Cpanel.

Now you should enjoy lots of empty space available to you in that hosting account -> no more files killing your disk space limit!

[/private]

About the Author

Alex Centeno MBA., is an international creative director and digital media strategist. Currently residing minutes away from the Research Triangle Park (RTP) - North Carolina, and with over 10 years of interactive marketing training and experience, Alex leads Merkados' international clients to maximizing their online business strategies. One of Alex's biggest strengths is his world-class capacity to effectively combine interactive marketing, digital media design and web development.

You may find further information about Alex Centeno MBA. at: and Twitter.

Sobre el Autor

Alex Centeno MBA., Es un director creativo y estratega de medios digitales reconocido internacionalmente. En la actualidad reside a tan solo minutos del Research Triangle Park (RTP) - Carolina del Norte, y con más de 10 años de entrenamiento y experiencia en marketing interactivo, Alex lidera a los clientes internacionales de Merkados™ para maximizar sus estrategias de negocios en línea. Una de las mayores fortalezas de Alex es su capacidad global de combinar de manera efectiva, mercadeo interactivo, diseño de medios digitales y desarrollo web.

Para más información sobre Alex Centeno MBA. puede visitar: y Twitter.