Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers

blists is a web-based interface to mailing list archives that works off indexed mbox files. There are two programs: bindex and bit. bindex generates or updates the index file (yes, incremental updates are supported). bit is a CGI program, which generates web pages on the fly.

To compile, simply run "make". There's currently no "install" target; you're supposed to copy the bindex and bit programs in place on your own, as appropriate for your setup.

You will likely want to have bindex run when new messages arrive. For example, you may invoke it from a .qmail-listname file like this:

|./bindex listname

This delivers new messages to an mbox file called "listname" and it immediately generates or updates the index file for it. Alternatively, you may choose to run bindex on cron.

The index file name is produced by adding the .idx suffix to the mbox filename, so in this example it will be "listname.idx". With the default params.h settings, the index file size is typically 100 KB plus around 3.5% of the mbox file's size.

bit is meant to be invoked via SSI (it will refuse to work otherwise), and it has only been tested with Apache so far. Here's an example SSI-enabled HTML file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--#include virtual="/cgi-bin/bit?header"-->
<style type="text/css">
.calendar { text-align: center; }
.ccell { background: #ccc; width: 5ex; padding: 2px; }
<!--#include virtual="/cgi-bin/bit?body"-->

Obviously, you'll need to adjust the /cgi-bin/bit paths, and you might need to add a filename suffix to match your web server configuration.

In order for the links generated by bit to point to valid URLs, as well as for the URLs to look pretty, you may use mod_rewrite rules like this:

RewriteEngine On
RewriteRule ^((listname1|listname2)/([0-9]{4}/([0-9]{2}/([0-9]{2}/([1-9][0-9]*)?)?)?)?)$ list.shtml?$1 [L]

To workaround a bug in Lynx where it would omit the trailing slash when following links to "..", add:

RewriteRule ^[a-z-]+([/0-9]*[0-9])?$ http://%{SERVER_NAME}%{REQUEST_URI}/ [R,L]

(where "[a-z-]+" is supposed to match your list names; adjust it if not).

To have separate HTML wrapper pages for different lists (such as to include different additional info on those pages), use:

RewriteRule ^(listname1|listname2)/(([0-9]{4}/([0-9]{2}/([0-9]{2}/([1-9][0-9]*)?)?)?)?)$ list-$1.shtml?$1/$2 [L]

To make use of the censorship feature (such as to hide spam messages), create a separate HTML wrapper page with:

<!--#include virtual="/cgi-bin/bit?header-censored"-->
<!--#include virtual="/cgi-bin/bit?body-censored"-->

then refer to it in more specific RewriteRule directives, which you need to place above the catch-all ones:

RewriteRule ^(listname1/2011/01/02/3)$ list-censor.shtml?$1 [L]

You may match multiple messages at once with trickier regexps:

RewriteRule ^(listname1/2011/01/(09/1|12/1|12/2))$ list-censor.shtml?$1 [L]

Good luck!

Powered by Openwall GNU/*/Linux - Powered by OpenVZ