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.
This script is Free Software released under BSD license.
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.
You can get the version 0.12 of the script here:
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 firstname.lastname@example.org ... Post by non-member 2 email@example.com Best online!!! Post by non-member 2 firstname.lastname@example.org 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.
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.
- Fixed behaviour with Getopt::Long 2.37 and later.
- Added --dry-run option.
- Page layout used by mailman 0.10 is now supported.
- Better handling of terminals of width different from 80.
- Propose to discard all messages after listing them in interactive mode.
- Added accept command and operation on individual messages.
- Initial release.