#!/bin/sh #------------------------------------------------------------------------------ # /usr/local/htdocs/mailmanager/mailmanager.cgi - mail manager script # # 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 fm # Last Update: $Id$ # # **** Thanks to Juergen Edner **** # **** Thanks to Harald Cramer **** # **** Thanks to Dennis Neuhaeuser **** # # 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=20 exim_spoolpath=/var/spool/exim exim_pidfile=$exim_spoolpath/exim-daemon.pid exim_ssmtp_pidfile=$exim_spoolpath/exim-ssmtp-daemon.pid lockfile=/etc/nologin no_fetch="unchecked" fetch_status="unchecked" no_exim="unchecked" exim_status="unchecked" no_ssmtp="unchecked" ssmtp_status="unchecked" no_pop3="unchecked" pop3_status="unchecked" no_imap4="unchecked" imap4_status="unchecked" # 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 "EIS Mail Manager" echo '' echo "" echo '' echo "" echo echo '' #-------------------------------------------------------- # check XINET killall -0 xinetd 2>/dev/null # -0 is only a check if [ $? -eq 0 ] then no_xinetd="" ## running else no_xinetd="true" ## not running fi #-------------------------------------------------------- # Check fetchmail killall -0 fetchmail 2>/dev/null # -0 is only a check if [ $? -eq 0 ] then no_fetch="" ## running else no_fetch="true" ## not running fi #-------------------------------------------------------- # check SMTP / exim if [ -e $exim_pidfile ] then no_exim="" ## running else no_exim="true" ## not running fi #-------------------------------------------------------- # check SSMTP if [ -e $exim_ssmtp_pidfile ] then no_ssmtp="" ## running else no_ssmtp="true" ## not running fi #-------------------------------------------------------- # check POP3 if [ -z "$no_xinetd" ] then grep 'disable[ \t]*=[ \t]no' /etc/xinetd.d/pop3 >/dev/null 2>&1 if [ $? -eq 0 ] then if [ ! -f $lockfile ] then no_pop3="" ## running fi fi else no_pop3="true" ## not running fi #-------------------------------------------------------- # check IMAP4 if [ -z "$no_xinetd" ] then grep 'disable[ \t]*=[ \t]no' /etc/xinetd.d/imap >/dev/null 2>&1 if [ $? -eq 0 ] then if [ ! -f $lockfile ] then no_imap4="" ## running fi fi else no_imap4="true" ## not running fi #-------------------------------------------------------- if [ -z "$no_fetch" ] then fetch_status="aktiv" startstop_M="Stop Mailserver" action_M=mailaction.cgi?Stop\ f_color="#00FF00" # green else fetch_status="inaktiv" startstop_M="Start Mailserver" action_M=mailaction.cgi?Start\ f_color="#FF0000" # red fi if [ -z "$no_exim" ] then smtp_status="aktiv" s_color="#00FF00" else smtp_status="inaktiv" s_color="#FF0000" fi if [ -z "$no_ssmtp" ] then ssmtp_status="aktiv" ss_color="#00FF00" else ssmtp_status="inaktiv" ss_color="#FF0000" fi if [ -z "$no_pop3" ] then pop3_status="aktiv" p_color="#00FF00" else pop3_status="inaktiv" p_color="#FF0000" fi if [ -z "$no_imap4" ] then imap_status="aktiv" i_color="#00FF00" else imap_status="inaktiv" i_color="#FF0000" fi #-------------------------------------------------------- if [ -f $lockfile ] then toggle_T="POP3/IMAP freigeben" else toggle_T="POP3/IMAP sperren" fi action_T=mailaction.cgi?Toggle if [ -z "${no_xinetd}" ] then xinetd_status="aktiv" x_color="#00FF00" toggle_X="Stop XINETD" action_X="mailaction.cgi?XINETD_Stop" else xinetd_status="inaktiv" x_color="#FF0000" toggle_X="Start XINETD" action_X="mailaction.cgi?XINETD_Start" fi #-------------------------------------------------------- echo '
EIS Mail Manager 1.0.3 © 2004, 2005, 2006 Marcus Herleb
' . /usr/local/htdocs/mailmanager/mailinfo.cgi echo "
 Mail Status
 Fetchmail $fetch_status
 SMTP Server $smtp_status
 SSMTP Server $ssmtp_status
 POP3 daemon *) $pop3_status
 IMAP4 daemon *) $imap_status
 XINETD daemon *) $xinetd_status
 
*) POP3 und IMAP4 laufen nur, wenn auch XINETD läuft.
 Administration
" if [ -z "$no_fetch" ] then echo " " fi echo " " if [ -z "${no_xinetd}" ] then echo " " fi echo "
 
" if [ -f /usr/bin/perl ] then echo " " fi echo " " exim_log_file=rejectlog if [ -s $exim_spool_dir/log/$exim_log_file ] then echo " " fi exim_log_file=paniclog if [ -s $exim_spool_dir/log/$exim_log_file ] then echo " " fi echo "
 Mail Statistik
 EXIM Statistik anzeigen 
 EXIM Mail Log anzeigen 
 Fetchmail Log anzeigen 
 Zurückgewiesene Mail 
 Panik Log 
 
Diese Seite erneuert sich alle '$RTIME' Sekunden.
Bis dahin werden angezeigte Zustände nach Änderungen nicht korrekt angezeigt, es sei denn, es wird ein manueller 'Refresh' gemacht.
" exit 0