#! /bin/sh
#----------------------------------------------------------------------------
# /tmp/install.sh - install mailman
#
# Copyright (c) 2008 the eisfair team, team(at)eisfair(dot)org
#
# Creation:     25.07.2004  om
# Last Update:  $Id$
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------

. /var/install/include/eislib

echo
mecho -info "Installing Mailman..."
sleep 1
echo

###
mkdir -p /var/mailman/archives/private
mkdir -p /var/mailman/lists
mkdir -p /var/mailman/locks/
mkdir -p /var/mailman/logs
mkdir -p /var/mailman/qfiles/virgin
mkdir -p /var/mailman/data
mkdir -p /usr/local/mailman/cron/senddigest

# setting access rights
/usr/local/mailman/bin/check_perms -f >/dev/null 2>&1

###
echo "adding Mailman to service menu..."
sleep 1
/var/install/bin/add-menu /var/install/menu/setup.services.menu /var/install/bin/setup.services.mailman "Mailman"


if [ ! -f /etc/config.d/mailman ]
then
    echo
    echo "Please change the siteadmins password:"
    /usr/bin/python /usr/local/mailman/bin/mmsitepass
fi



### -------------------------------------------------------------------------
### make default config files
### -------------------------------------------------------------------------
/var/install/config.d/mailman-update.sh
/var/install/config.d/mailman.sh

/var/install/bin/edit -apply mailman "Edit mailman configuration"

echo

exit 0