One of our customer wanted to delete all messages from mailman archives. He had around 101 mailing lists and hence manually deleting them was not possible. I wrote a small script to delete the contents and attachments – and Bingo – all cleared !! :- )
Check out the script here
First I took the list details into a file called ss
For a given mailing list, the path “/usr/local/cpanel/3rdparty/mailman/archives/private” contains two folders namely listname_abc.org and listname_abc.org.mbox . listname_abc.org contains a folder called ‘attachments’ which contains the attachments and files of following three types.
2013-April 2013-April.txt 2013-April.txt.gz
Our intent is to delete all such files and contents inside attachments folder without deleting the folder itself. The following script does it.