From b9d6bacfc352212bd4fa9c7bc2c7c84c1d7fb6ef Mon Sep 17 00:00:00 2001 From: kueller Date: Mon, 3 Jan 2011 10:48:06 +0000 Subject: [PATCH] Neue Version V963 git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_sendmail@5933 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init.d/smtp | 44 ++++++++++++++++ etc/init/smtp.conf | 15 ++++++ init/genpkg | 56 ++++++++++++++++++++ tmp/postinstall | 127 +++++++++++++++++++++++++++++++++++++++++++++ tmp/postremove | 85 ++++++++++++++++++++++++++++++ 5 files changed, 327 insertions(+) create mode 100644 etc/init.d/smtp create mode 100644 etc/init/smtp.conf create mode 100644 init/genpkg create mode 100644 tmp/postinstall create mode 100644 tmp/postremove diff --git a/etc/init.d/smtp b/etc/init.d/smtp new file mode 100644 index 0000000..2d95b2f --- /dev/null +++ b/etc/init.d/smtp @@ -0,0 +1,44 @@ +#!/bin/bash +#start/stop für sendmail +#(c) Rainmaker MultiMedia OHG +# +#$Author$ +#$Date$ +#$Revision$ +# +#$Log$ +#Revision 1.2 2003/04/19 07:53:05 kueller +#restart option eingebaut +# +#Revision 1.1 2001/09/24 12:14:43 kueller +#von sendmail umbenannt. Ausserdem korrekturen - korrektes Beenden von +#Sendmail nun mit killproc routine +# +#Revision 1.1.1.1 2001/09/24 11:29:11 kueller +#AddOns für sendmail +# +# + +source /etc/init.d/functions + +case "$1" in + start) + if [ -f /etc/mail/sendmail.cf ]; then + echo -n "Starting Sendmail (smtp Server)" + loadproc /usr/sbin/sendmail -bd -q30m -om + fi + ;; + stop) + if [ -f /etc/mail/sendmail.cf ]; then + echo -n "Stopping Sendmail (smtp Server)" + killproc sendmail + fi + ;; + restart) + $0 stop + sleep 1 + $1 start + ;; + *) + echo "USAGE: $0 {start|stop|restart}" +esac diff --git a/etc/init/smtp.conf b/etc/init/smtp.conf new file mode 100644 index 0000000..4d801f6 --- /dev/null +++ b/etc/init/smtp.conf @@ -0,0 +1,15 @@ +description "sendmail Daemon startup" +author "Harald Kueller " +version 1.0 +emits none special + +start on (runlevel [2345] and (started ifup)) +stop on runlevel [016] + +console none + +script + if [ -f /etc/mail/sendmail.cf ]; then + /usr/sbin/sendmail -bD -q30m -om + fi +end script diff --git a/init/genpkg b/init/genpkg new file mode 100644 index 0000000..5709c5f --- /dev/null +++ b/init/genpkg @@ -0,0 +1,56 @@ +#!/bin/bash +#genpkg Script für sendmail +#(c) Rainmaker MultiMedia OHG +# +#$Author$ +#$Date$ +#$Revision$ +# +#$Log$ +#Revision 1.8 2001/10/29 11:35:02 kueller +#Fehler beim Setzten der Rechte für smtp init script. Durch andere Platzierung +#des Kommandos korrigiert +# +#Revision 1.7 2001/10/17 08:34:51 kueller +#Rechte Korrektur für init script +# +#Revision 1.6 2001/09/30 17:29:19 kueller +#/etc/mail/local-host-names wird nun angelegt +# +#Revision 1.5 2001/09/30 17:05:22 kueller +#/etc/mail wird nun korrekt angelegt +# +#Revision 1.4 2001/09/24 12:25:53 kueller +#Links in rc?.d korrigiert +# +#Revision 1.3 2001/09/24 12:13:25 kueller +#/var/spool/mqueue wird nun angelegt +# +#Revision 1.2 2001/09/24 12:01:46 kueller +#Rechte für /etc/init.d/sendmail werden jetzt korrekt gesetzt. +# +#Revision 1.1.1.1 2001/09/24 11:29:11 kueller +#AddOns für sendmail +# +# + +WDIR=`pwd` +mkdir -p etc/mail +touch etc/mail/local-host-names +mkdir -p var/spool/mqueue +if [ -d /var/install/sysvinit ]; then + 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 ../smtp K70smtp + cd .. + done + for i in 3 4 5; do + cd rc$i.d + ln -s ../smtp S20smtp + cd .. + done + cd $WDIR +fi diff --git a/tmp/postinstall b/tmp/postinstall new file mode 100644 index 0000000..8b634a8 --- /dev/null +++ b/tmp/postinstall @@ -0,0 +1,127 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.rainmaker-mm.de/RMM/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source$ +# +#(c) Rainmaker MultiMedia OHG +#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. +# +#Beschreibung: +#postinstall für das Sendmail Packet. Nach Abfrage diverse Konfigurations- +#parameter wird mit dem m4 Mechanismuss eine Konfiguration für Sendmail +#erstellt. +# +#Aufrufparameter: +#keine +# +#Letzte Änderung von: $Author: kueller $ +#Datum der letzten Änderung: $Date: 2007-04-29 10:56:32 +0000 (So, 29 Apr 2007) $ +#Version der Datei: $Revision: 3786 $ +# +#$Log$ +#Revision 1.11 2007/04/29 10:56:32 kueller +#Gruppe smmsp bekommt gid 23, user smmsp uid 44 +# +#Revision 1.10 2004/09/19 15:02:42 kueller +#Anpassung des useradd - ist der user bereits im install system vorhanden +#schlug dieser fehl. +# +#Revision 1.9 2002/10/09 08:15:30 kueller +#Einsatz des neuen GPL Monsum Projekt Headers +# +# +#Revision 1.8 2002/06/21 12:41:01 hkueller +#Rechte der Clientmqueue werden als tmp rechte (1777) gesetzt. damit +#funktioniert sendmail mua auch richtig +# +#Revision 1.7 2002/06/21 12:16:38 hkueller +#Korrektur der Berechtigungen für /var/spool/clientmqueue. Sendmail kann so +#auch als MUA arbeiten (link sendmail auf mail).. +# +#Revision 1.6 2002/02/07 19:50:54 hkueller +#Korrektur der Macroeinstellungen zur Sendmail.cf generierung +# +#Revision 1.5 2002/02/06 11:45:53 hkueller +#Abfrage, ob neu anzulegene User bereits vorhanden, hinzugefügt +# +#Revision 1.4 2001/10/29 11:26:19 kueller +#Verwendung von $WDIR im postinstall kollidiert mit $WDIR in installpkg. Dadurch +#entstehen fehler bei der installation mehrerer packages +#$WDIR in $INSTDIR umbenannt +# +#Revision 1.3 2001/09/24 12:19:17 kueller +#Fehler - durch den Wegfall der include option in $HOSTNAME.mc muß +#natürlich die nächste Ausgabe eine neue Datei erzeugen, und nicht anhängen! +# +#Revision 1.2 2001/09/24 12:08:43 kueller +#include darf in M4 Konfigfile nicht mehr verwendet werden - wird direkt +#in sendmail.cf geschrieben, was zu fehlermeldungen und abbruch von sendmail +#führt +# +#Revision 1.1.1.1 2001/09/24 11:29:11 kueller +#AddOns für sendmail +# +# + +if ! getent group smmsp 2>&1 >/dev/null; then + groupadd -g 23 smmsp +fi + +if ! getent passwd smmsp 2>&1 >/dev/null; then + useradd -u 44 smmsp -g smmsp -s /bin/fals -d /tmp +fi + +chown root:smmsp /usr/sbin/sendmail +chown smmsp:smmsp /var/spool/clientmqueue +chmod 1777 /var/spool/clientmqueue +INSTDIR=`pwd` +cd /usr/share/sendmail/cf/cf +if [ ! -f /tmp/NOQUEST ]; then + echo -n "Soll ich eine Konfiguration für Sendmail erstellen ? [y/N]" + read ANSWER + if [ $ANSWER == "y" ]; then + echo "include(\`../m4/cf.m4')dnl" >>$HOSTNAME.mc + echo "OSTYPE(\`mklinux')dnl" >$HOSTNAME.mc + echo "FEATURE(\`use_cw_file')dnl" >>$HOSTNAME.mc + echo "FEATURE(\`nouucp',\`reject')dnl" >>$HOSTNAME.mc + echo "FEATURE(\`always_add_domain')dnl" >>$HOSTNAME.mc + echo -n "Soll Alle Mail als von diesem Rechner kommend maskiert werden ? [y/N]" + read ANSWER + if [ $ANSWER == "y" ]; then + echo "MASQUERADE_AS(\`$HOSTNAME'.\`dnsdomainname')dnl" >>$HOSTNAME.mc + echo "FEATURE(\`allmasquerade')dnl" >>$HOSTNAME.mc + echo "FEATURE(\`masquerade_envelope')dnl" >>$HOSTNAME.mc + fi + DNSDOMAIN=`dnsdomainname` + echo -n "Soll dieses System ein Relay für die Domain $DNSDOMAIN sein ? [y/N]" + read ANSWER + if [ $ANSWER == "y" ]; then + echo "FEATURE(\`relay_entire_domain')dnl" >>$HOSTNAME.mc + fi + echo -n "Soll ein Mail Relay benutzt werden ? [y/N]" + read ANSWER + if [ $ANSWER == "y" ]; then + echo -n "Bitte Adresse des zu verwendenden Mail Relays angeben: " + read RELAY + echo "define(\`SMART_HOST',\`smtp:$RELAY')dnl" >>$HOSTNAME.mc + fi + echo "MAILER(\`smtp')dnl" >>$HOSTNAME.mc + fi +fi +make $HOSTNAME.cf +cp $HOSTNAME.cf /etc/mail/sendmail.cf +cd $INSTDIR diff --git a/tmp/postremove b/tmp/postremove new file mode 100644 index 0000000..6793a9b --- /dev/null +++ b/tmp/postremove @@ -0,0 +1,85 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.rainmaker-mm.de/RMM/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source$ +# +#(c) Rainmaker MultiMedia OHG +#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. +# +#Beschreibung: +#postinstall für das Sendmail Packet. Nach Abfrage diverse Konfigurations- +#parameter wird mit dem m4 Mechanismuss eine Konfiguration für Sendmail +#erstellt. +# +#Aufrufparameter: +#keine +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.11 2007/04/29 10:56:32 kueller +#Gruppe smmsp bekommt gid 23, user smmsp uid 44 +# +#Revision 1.10 2004/09/19 15:02:42 kueller +#Anpassung des useradd - ist der user bereits im install system vorhanden +#schlug dieser fehl. +# +#Revision 1.9 2002/10/09 08:15:30 kueller +#Einsatz des neuen GPL Monsum Projekt Headers +# +# +#Revision 1.8 2002/06/21 12:41:01 hkueller +#Rechte der Clientmqueue werden als tmp rechte (1777) gesetzt. damit +#funktioniert sendmail mua auch richtig +# +#Revision 1.7 2002/06/21 12:16:38 hkueller +#Korrektur der Berechtigungen für /var/spool/clientmqueue. Sendmail kann so +#auch als MUA arbeiten (link sendmail auf mail).. +# +#Revision 1.6 2002/02/07 19:50:54 hkueller +#Korrektur der Macroeinstellungen zur Sendmail.cf generierung +# +#Revision 1.5 2002/02/06 11:45:53 hkueller +#Abfrage, ob neu anzulegene User bereits vorhanden, hinzugefügt +# +#Revision 1.4 2001/10/29 11:26:19 kueller +#Verwendung von $WDIR im postinstall kollidiert mit $WDIR in installpkg. Dadurch +#entstehen fehler bei der installation mehrerer packages +#$WDIR in $INSTDIR umbenannt +# +#Revision 1.3 2001/09/24 12:19:17 kueller +#Fehler - durch den Wegfall der include option in $HOSTNAME.mc muß +#natürlich die nächste Ausgabe eine neue Datei erzeugen, und nicht anhängen! +# +#Revision 1.2 2001/09/24 12:08:43 kueller +#include darf in M4 Konfigfile nicht mehr verwendet werden - wird direkt +#in sendmail.cf geschrieben, was zu fehlermeldungen und abbruch von sendmail +#führt +# +#Revision 1.1.1.1 2001/09/24 11:29:11 kueller +#AddOns für sendmail +# +# + +if getent passwd smmsp 2>&1 >/dev/null; then + userdel smmsp +fi +if getent group smmsp 2>&1 >/dev/null; then + groupdel smmsp +fi