C++ wxWidgets Linux Win32 OS X Autoconf Bakefile Boost GCC GNU IMAP MSVC Perl Python SMTP STL TCP/IP Threads Unix ZSH

mladmin

Overview

mladmin main purpose in the life is to automatically discard the messages held for administrative approval by Mailman mailing list manager. If you use Mailman (for example because your mailing lists are hosted by SourceForge) you probably get as much spam as I do, that is anything between 1 and 10 messages daily. I got tired of having to click on half a dozen checkboxes in my browser to delete them manually and so wrote this tiny script to do it automatically. It is especially useful for the announcement lists where normally no messages are posted at all so there is no danger of discarding a legitimate message.

License

This script is Free Software released under BSD license.

Requirements

You need Perl 5.004 (it might work with the previous versions but this is the least one I tested it with) and a bunch of modules all of which can be retrieved from CPAN including (but possibly not limited to) HTTP::Cookies, LWP::UserAgent, HTML::Parser and Crypt::SSLeay.

Under Unix you may wish to additionally install Term::Size module if you are using a terminal of non standard (i.e. different from 80) width.

The program has been tested under Linux with Perl 5.004 and 5.005 and Windows 2000 with ActivePerl build 631 but it should work on the other platforms as well.

Download

You can get the version 0.12 of the script here:

Usage instructions

The script has one required parameter: the admindb URL of the list, for example http://lists.sourceforge.net/lists/admindb/list-name for the lists hosted on SourceForge.

By default, it will list the messages being held for approval, if any, and ask you if you want to discard all the messages which is the most common action. If the second parameter is specified it can be one of list, discard or accept. The first just lists the messages without proposing to discard them, the others discard or accept all (if there are no more parameters) or just the specified (after them on command line) messages.

Please note that there is no way to undelete discarded messages later, so use the discard command carefully!

Other supported options are:

  • --help, --version: self explanatory.
  • --pass=password: specify the administrative password on the command line (otherwise you'll be asked for it).
  • --cookies=file: if this option is given, the administrative cookie will be saved to the specified file and you won't have to enter the password again until it expires. You should understand that storing Mailman cookies is a security risk and use this options with care.
  • --proxy=url: specify the proxy to use.

Example of a session using this script:

% ./mladmin.pl --cookies=list.cookies \
    		http://lists.sf.net/lists/admindb/list-name list
Administrative password for list-name: *****
password will be saved in list.cookies file
Logging in to list-name... ok.
2 messages held for approval for the list list-name:

 N From                  Subject                 Reason
-------------------------------------------------------------------
 1 spammer@yahoo.com     ...                     Post by non-member
 2 someone@somewhe.re    Best online!!!          Post by non-member
 2 spammer@lycos.co.kr   YOU WON 1 TRILLION   Post by non-member
-------------------------------------------------------------------
% ./mladmin.pl --cookies=list.cookies \
    http://lists.sf.net/lists/admindb/list-name accept 2
Preparing to accept 1 message... 1 message accepted.
% ./mladmin.pl --cookies=list.cookies \
    http://lists.sf.net/lists/admindb/list-name discard
Preparing to discard all messages... 2 messages discarded.

Security considerations

If you are concerned about security, you should only use the script via HTTPS (simply replace http: with https: above) to avoid the passwords being sent in clear text. For HTTPS support to work, you will need have Crypt::SSLEay and Net::SSLEay Perl modules installed.

Of course, using the --cookies option is also a bad idea from the security view point.

Change log

0.12
Fixed behaviour with Getopt::Long 2.37 and later.
0.11
Added --dry-run option.
0.10
Page layout used by mailman 0.10 is now supported.
0.03
Better handling of terminals of width different from 80.
Propose to discard all messages after listing them in interactive mode.
0.02
Added accept command and operation on individual messages.
0.01
Initial release.
June 23, 2015
Release of where-included: a new tool for C/C++ programmers for finding the header file dependencies.
July 28, 2014
A new release of Bakefile, a makefile generator tool, is now available.
July 20, 2014
We released a Munin plugin allowing to monitor the parameters of Freebox (French ISP modem).
November 11, 2013
wxWidgets 3.0, the first stable release of wxWidgets since several years, is now available.
September 1, 2013
Yahoo! Groups redesign has unfortunately made inoperable our popular yahoo2mbox script.
August 22, 2013
Added apache-splice-logs tool page.
March 31, 2013
Added new svn-to-git migration article.
August 6, 2012
Minor mladmin update: fix the script to work with recent Perl versions.
July 25, 2012
New diff-pdf tool description added.
April 27, 2012
wxWidgets training course proposed by TT-Solutions has been updated to cover version 3.0, please see training page for more information including the plan and some examples.
December 5, 2011
Another new script to help dealing with removing #pragma once from your code if needed.