#!/bin/sh
# erstellt die /etc/mail/mailertable für sendmail
set $(cat /tmp/ipsub_intern.txt | tr "/" " ")
IP_INT=$1
SUB_INT=$2
set $(cat /tmp/ipsub_extern.txt | tr "/" " ")
IP_EXT=$1
SUB_EXT=$2
set $(echo $IP_INT | tr "." " ")
IP_INT_LAST=$4
IP_INT_LAST_P=`expr $4 + 1` IP_PARTNER=$1.$2.$3.$IP_INT_LAST_P
rm -f /etc/mail/mailertable cp /KNOPPIX/etc/mail/mailertable /etc/mail/
rm -f /etc/mail/access /etc/mail/relay-domains
echo "Erstelle /etc/mail/mailertable"
echo "pcsec1.nm.informatik.uni-muenchen.de smtp:192.168.216.201" > /etc/mail/mailertable
echo "pcsec2.nm.informatik.uni-muenchen.de smtp:192.168.216.2" >> /etc/mail/mailertable
echo "pcsec3.nm.informatik.uni-muenchen.de smtp:192.168.216.203" >> /etc/mail/mailertable
echo "pcsec4.nm.informatik.uni-muenchen.de smtp:192.168.216.24" >> /etc/mail/mailertable
echo "pcsec5.nm.informatik.uni-muenchen.de smtp:192.168.216.205" >> /etc/mail/mailertable
echo "pcsec6.nm.informatik.uni-muenchen.de smtp:192.168.216.46" >> /etc/mail/mailertable
echo "pcsec7.nm.informatik.uni-muenchen.de smtp:192.168.216.207" >> /etc/mail/mailertable
echo "pcsec8.nm.informatik.uni-muenchen.de smtp:192.168.216.68" >> /etc/mail/mailertable
echo "pcsec9.nm.informatik.uni-muenchen.de smtp:192.168.216.209" >> /etc/mail/mailertable
echo "pcsec10.nm.informatik.uni-muenchen.de smtp:192.168.216.110" >> /etc/mail/mailertable
echo "Erstelle /etc/mail/access"
echo "$IP_PARTNER RELAY" > /etc/mail/access
echo "secserv.nm.informatik.uni-muenchen.de 550 Relay denied" >> /etc/mail/access
name=$(hostname)
echo $name".nm.informatik.uni-muenchen.de" > /etc/mail/relay-domains