#!/bin/sh #------------------------------------------------------------------------------ # /usr/local/htdocs/mailmanager/mailmanager.cgi - component of mailmanager # package # # Copyright (c) 2004-2017 Marcus Herleb, marcus(at)herleb(dot)de # Copyright (c) 2018-2018 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2004-03-01 mh # 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.. #------------------------------------------------------------------------------ myname=`basename $0` tag=`date +%d.%m.%Y` uhr=`date +%T` RTIME=5 # HTML-Header echo "Content-Type: text/html; charset=iso-8859-1" echo "Cache-control: no-store" # HTTP/1.1 (or no-cache?) echo "Pragma: no-cache" # HTTP/1.0 echo echo "
" echo ""
if [ "$QUERY_STRING" = "Fetch" ]
then
echo "$tag $uhr"
echo "
"
/etc/init.d/mail wake
echo "
"
echo "Fetchmail angestossen ...
"
elif [ "$QUERY_STRING" = "Stop" ]
then
echo "$tag $uhr"
echo "
"
/etc/init.d/mail stop
echo "
"
/etc/init.d/mail status
echo "
"
echo "Mailserver deaktiviert
"
elif [ "$QUERY_STRING" = "Start" ]
then
echo "$tag $uhr"
echo "
"
/etc/init.d/mail start
echo "
"
/etc/init.d/mail status
echo "
"
echo "Mailserver aktiviert
"
elif [ "$QUERY_STRING" = "Check" ]
then
echo "TLS Zertifikate:
"
echo "
"
/var/install/config.d/mail.sh showcertdates | more
echo "
"
echo ''
elif [ "$QUERY_STRING" = "Run" ]
then
echo "$tag $uhr"
echo "
"
/usr/sbin/runq
echo "
"
echo "Queue-Run gestartet ..."
elif [ "$QUERY_STRING" = "Toggle" ]
then
echo "$tag $uhr"
echo "
"
toggle_mailaccess=/etc/nologin
if [ -f $toggle_mailaccess ]
then
echo "Status: POP3/IMAP Zugang gesperrt."
else
echo "Status: POP3/IMAP Zugang erlaubt."
fi
yes | /var/install/bin/mail-toggle-access
echo "
"
if [ -f $toggle_mailaccess ]
then
echo "POP3/IMAP Zugang gesperrt.
"
else
echo "POP3/IMAP Zugang erlaubt.
"
fi
elif [ "$QUERY_STRING" = "XINETD_Start" ]
then
echo "$tag $uhr"
echo "
"
/etc/init.d/xinetd start
echo "
"
echo ""
/etc/init.d/xinetd status
echo "
"
elif [ "$QUERY_STRING" = "XINETD_Stop" ]
then
echo "$tag $uhr"
echo "
"
/etc/init.d/xinetd stop
echo "
"
echo ""
/etc/init.d/xinetd status
echo "
"
elif [ "$QUERY_STRING" = "NONE" ]
then
# do/show nothing
echo
else
echo "$tag $uhr"
echo '
'
echo "Aktion $QUERY_STRING nicht definiert!"
echo "
"
fi
echo ""