summaryrefslogtreecommitdiff
path: root/init-mailmanarchive
diff options
context:
space:
mode:
Diffstat (limited to 'init-mailmanarchive')
-rwxr-xr-xinit-mailmanarchive28
1 files changed, 28 insertions, 0 deletions
diff --git a/init-mailmanarchive b/init-mailmanarchive
new file mode 100755
index 0000000..edcc240
--- /dev/null
+++ b/init-mailmanarchive
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+bindir="/usr/lib/mailman/bin"
+basedir="/var/lib/mailman/archives/private"
+
+[ $# == 0 ] && echo "Usage: `basename $0` <listname> [<listname>...]"
+
+for list in $@; do
+ mboxdir="$basedir/$list.mbox"
+ mboxfile="$mboxdir/$list.mbox"
+ htmldir="$basedir/$list"
+
+ if [ "x$1" != "" -a -d $mboxdir ]; then
+ echo "Renewing list \"$list\"..."
+
+ # Make sure the mbox file exists even if no mails are archived yet
+ touch $mboxfile && chown list.list $mboxfile && chmod 664 $mboxfile
+ rm -rf $htmldir
+
+# $bindir/arch $list
+ mkdir -p $htmldir && chown list.list $htmldir && chmod 2755 $htmldir
+ su list "mhonarc -outdir $htmldir -idxfname index.html -rcfile /etc/mailman/mhonarc.mrc -title \"$list Archive (by Date)\" -ttitle \"$list Archive (Threaded)\" $mboxfile"
+
+ echo "Done with list \"$list\"!"
+ else
+ echo "Problem renewing list \"$list\"."
+ fi
+done