commit 41a8ab45147c0237528cda8449d74d81bda0d1e4 Author: kueller Date: Sat May 3 16:58:44 2008 +0000 V961 Tree Umbau git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_courier@4240 504e572c-2e33-0410-9681-be2bf7408885 diff --git a/etc/init.d/smtp b/etc/init.d/smtp new file mode 100644 index 0000000..05887cd --- /dev/null +++ b/etc/init.d/smtp @@ -0,0 +1,240 @@ +#! /bin/sh +# +# chkconfig: 2345 35 65 +# description: Courier - SMTP server +# +# NOTE: The 'restart' here does a "hard" stop, and a start. Be gentle, use +# "courierd restart" for a kindler, gentler, restart. +# +# + + + +prefix="/opt/courier" +exec_prefix="/opt/courier" +sysconfdir="/etc/courier" +sbindir="${exec_prefix}/sbin" +libexecdir="/opt/courier/libexec" +datadir="/opt/courier/share" + +case "$1" in +start) + cd / + # Start daemons. + touch /var/lock/subsys/courier + + echo -n "Starting Courier mail server:" + + # First time after install create aliases.dat and makesmtpaccess.dat + + test -f ${sysconfdir}/aliases.dat || ${sbindir}/makealiases + + esmtpdcert=0 + + . ${sysconfdir}/esmtpd + case x$ESMTPDSTART in + x[yY]*) + esmtpdcert=1 + ;; + esac + + test -f ${sysconfdir}/${ACCESSFILE}.dat || ${sbindir}/makesmtpaccess + + . ${sysconfdir}/esmtpd-msa + case x$ESMTPDSTART in + x[yY]*) + esmtpdcert=1 + ;; + esac + + test -f ${sysconfdir}/${ACCESSFILE}.dat || ${sbindir}/makesmtpaccess-msa + + ${sbindir}/courierfilter start + echo -n " courierfilter" + + if test -x /usr/sbin/authdaemond + then + /usr/sbin/authdaemond start + echo -n " authdaemond" + fi + + if test -x ${sbindir}/courierldapaliasd + then + ${sbindir}/courierldapaliasd start + echo -n " courierldapaliasd" + fi + + if test -f ${libexecdir}/courier/sqwebmaild + then + ${sbindir}/webmaild start + echo -n " webmail" + fi + + ${sbindir}/courier start + echo -n " courierd" + + if test "$esmtpdcert" = 1 + then +# If we do not have a certificate, make one up. + + if test ! -f ${datadir}/esmtpd.pem + then + if test -x $COURIERTLS + then + echo -n " generating-ESMTP-SSL-certificate..." + ${sbindir}/mkesmtpdcert >/dev/null 2>&1 + fi + fi + fi + + . ${sysconfdir}/esmtpd + case x$ESMTPDSTART in + x[yY]*) + + ${sbindir}/esmtpd start + echo -n " esmtpd" + ;; + esac + + . ${sysconfdir}/esmtpd-msa + case x$ESMTPDSTART in + x[yY]*) + + ${sbindir}/esmtpd-msa start + echo -n " esmtpd-msa" + ;; + esac + + if test -x ${sbindir}/pop3d + then + POP3DSTART="" + POP3DSSLSTART="" + + if test -f ${sysconfdir}/pop3d + then + . ${sysconfdir}/pop3d + fi + case x$POP3DSTART in + x[yY]*) + ${sbindir}/pop3d start + echo -n " pop3d" + ;; + esac + if test -f ${sysconfdir}/pop3d-ssl + then + . ${sysconfdir}/pop3d-ssl + fi + case x$POP3DSSLSTART in + x[yY]*) + if test -x $COURIERTLS + then +# If we do not have a certificate, make one up. + + if test ! -f ${datadir}/pop3d.pem + then + echo -n " generating-POP3-SSL-certificate..." + + ${sbindir}/mkpop3dcert >/dev/null 2>&1 + fi + + ${sbindir}/pop3d-ssl start && \ + echo -n " pop3d-ssl" + fi + ;; + esac + fi + + if test -x ${sbindir}/imapd + then + . ${sysconfdir}/imapd + case x$IMAPDSTART in + x[yY]*) + ${sbindir}/imapd start + echo -n " imapd" + ;; + esac + . ${sysconfdir}/imapd-ssl + case x$IMAPDSSLSTART in + x[yY]*) + if test -x $COURIERTLS + then +# If we do not have a certificate, make one up. + + if test ! -f ${datadir}/imapd.pem + then + echo -n " generating-IMAP-SSL-certificate..." + + ${sbindir}/mkimapdcert >/dev/null 2>&1 + fi + + ${sbindir}/imapd-ssl start && \ + echo -n " imapd-ssl" + fi + ;; + esac + fi + + echo "" + ;; +stop) + echo -n "Stopping Courier mail server:" + + if test -x ${sbindir}/imapd + then + ${sbindir}/imapd stop + echo -n " imapd" + fi + + if test -x ${sbindir}/imapd-ssl + then + ${sbindir}/imapd-ssl stop + echo -n " imapd-ssl" + fi + + ${sbindir}/esmtpd-msa stop + echo -n " esmtpd-msa" + + ${sbindir}/esmtpd stop + echo -n " esmtpd" + + if test -x ${sbindir}/pop3d + then + ${sbindir}/pop3d stop + echo -n " pop3d" + fi + + if test -x ${sbindir}/pop3d-ssl + then + ${sbindir}/pop3d-ssl stop + echo -n " pop3d-ssl" + fi + + ${sbindir}/courier stop + echo -n " courierd" + + if test -f ${libexecdir}/courier/sqwebmaild + then + ${sbindir}/webmaild stop + echo -n " webmail" + fi + + if test -x ${sbindir}/courierldapaliasd + then + ${sbindir}/courierldapaliasd stop + echo -n " courierldapaliasd" + fi + + if test -x /usr/sbin/authdaemond + then + /usr/sbin/authdaemond stop + echo -n " authdaemond" + fi + ${sbindir}/courierfilter stop + echo " courierfilter" + ;; +restart) + $0 stop + $0 start + ;; +esac +exit 0 diff --git a/etc/sysconfig/profile.d/courier b/etc/sysconfig/profile.d/courier new file mode 100755 index 0000000..c5ec69b --- /dev/null +++ b/etc/sysconfig/profile.d/courier @@ -0,0 +1,10 @@ +#!/bin/bash +# +# System Script for courier +# $Author$ +# $Date$ +# $Revision$ +# + +MANPATH=$MANPATH:/opt/courier/man +export MANPATH diff --git a/init/genpkg b/init/genpkg new file mode 100644 index 0000000..4b8f5e6 --- /dev/null +++ b/init/genpkg @@ -0,0 +1,22 @@ +#!/bin/bash +# +#$Author$ +#$Date$ +#$Revision$ +# + +WDIR=`pwd` +cd etc/init.d +chmod 755 smtp +mkdir rc{0,1,2,3,4,5,6}.d +for i in 0 1 2 6; do + cd rc$i.d + ln -s /etc/init.d/smtp K70smtp + cd .. +done +for i in 3 4 5; do + cd rc$i.d + ln -s /etc/init.d/smtp S20smtp + cd .. +done +cd $WDIR diff --git a/tmp/postinstall b/tmp/postinstall new file mode 100644 index 0000000..f1109cf --- /dev/null +++ b/tmp/postinstall @@ -0,0 +1,43 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source$ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist 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. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not write to the Free Software Foundation, +#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#Script: +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +LIBINST=`grep "/opt/courier/lib/courier" /etc/ld.so.conf` +if [ ! "$LIBINST" ]; then + echo "/opt/courier/lib/courier" >>/etc/ld.so.conf +fi +ldconfig +crontab -l >/tmp/crontab.$$ +echo >>/tmp/crontab.$$ '10 * * * * su - bin -c "/opt/courier/share/sqwebmail/cleancache.pl" \>/dev/null 2\>&1' +crontab /tmp/crontab.$$ +rm /tmp/crontab.$$ + +if [ -f /usr/sbin/sendmail ]; then + mv /usr/sbin/sendmail /usr/sbin/sendmail.bak +fi + +ln -s /opt/courier/bin/sendmail /usr/sbin