[Mailman-Users] public/private listinfo pages

Anthony R. Thompson athomps at adf.org
Tue Jun 22 22:13:22 CEST 2010


On 6/22/2010 11:51 AM, Michael Anderson wrote:
> I have several lists on the same server, all with the same domain name. 
> I currently have a public "listinfo" page which displays only selected 
> lists that have the "advertise" option enabled.
> How can I set up a second private (protected with .htaccess) page which 
> shows all of the lists?

Mike, if it was me I'd do the following:

* Set up the directory you want the page to be in, with the .htaccess 
protection you want

* Set up an index.html page there that uses Apache's server side include 
mechanism to include index.inc, with something like:

<p>We have the following mailing lists:</p>
<ul>
<!--#include virtual="index.inc" -->
</ul>

* Then do the following, either manually or probably more likely on a 
regular basis via cron:

rm -f /path/to/index.inc; ls -1 /var/lib/mailman/archives/private | 
egrep -v mbox | perl -ne 'chomp; s#/$##; print qq^<li><a 
href="/mailman/listinfo/$_">$_</a></li>\n^;' >> /path/to/index.inc

(with that ls -1 command being all on one line)

There are a lot of assumptions there, for example that your archive 
directory is in /var/lib/mailman/archives, that no one will access the 
page in the very small time between the rm and the ls/perl, etc.

You could make it fancier (such as writing to a temp file and then 
moving over the original inc file), but for me the above would probably 
be "good enough".

hope this helps,
Anthony



More information about the Mailman-Users mailing list