summaryrefslogtreecommitdiff
path: root/init-mailmanarchive
blob: 46fe25db3cfed8d4d7ecefd5831959587036e9a5 (plain)
  1. #!/bin/bash
  2. #
  3. # /usr/local/sbin/init-mailmanarchive
  4. # Copyright 2002-2002 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: init-mailmanarchive,v 1.3 2002-10-04 11:24:28 jonas Exp $
  7. #
  8. # Rebuild mailman archive(s)
  9. #
  10. bindir="/usr/lib/mailman/bin"
  11. basedir="/var/lib/mailman/archives/private"
  12. [ $# == 0 ] && echo "Usage: `basename $0` <listname> [<listname>...]"
  13. for list in $@; do
  14. mboxdir="$basedir/$list.mbox"
  15. mboxfile="$mboxdir/$list.mbox"
  16. htmldir="$basedir/$list"
  17. if [ "x$1" != "" -a -d $mboxdir ]; then
  18. echo "Renewing list \"$list\"..."
  19. # Make sure the mbox file exists even if no mails are archived yet
  20. touch $mboxfile && chown list.list $mboxfile && chmod 664 $mboxfile
  21. rm -rf $htmldir
  22. # $bindir/arch $list
  23. mkdir -p $htmldir && chown list.list $htmldir && chmod 2755 $htmldir
  24. su list "mhonarc -outdir $htmldir -idxfname index.html -rcfile /etc/local-COMMON/mailman/mhonarc.mrc -title \"$list Archive (by Date)\" -ttitle \"$list Archive (Threaded)\" $mboxfile"
  25. echo "Done with list \"$list\"!"
  26. else
  27. echo "Problem renewing list \"$list\"."
  28. fi
  29. done