[Postfixbuch-users] Re: Echo Server?

Ralf Hildebrandt Ralf.Hildebrandt at charite.de
Fr Mai 2 18:29:27 CEST 2003


* Andreas Meyer <anmeyer at anup.de>:

> ok! Schätze fällt unter Betriebsgeheimnis.

Nee. Attached.

-- 
Ralf Hildebrandt (Im Auftrag des Referat V a)   Ralf.Hildebrandt at charite.de
Charite Campus Mitte                            Tel.  +49 (0)30-450 570-155
Referat V a - Kommunikationsnetze -             Fax.  +49 (0)30-450 570-916
AIM: ralfpostfix
-------------- nächster Teil --------------
#!/bin/sh
#set -x

DATE=`/bin/date`

IN=/tmp/ECHO-INPUT.$$
OUT=/tmp/ECHO-OUTPUT.$$
PID=$$
rm -f $IN $OUT

cat > $IN

SUBJECT=`grep "^Subject: " $IN | head -1 | sed "s,^Subject: ,,"`

if [ "$SENDER" = "" ]
then
     /usr/bin/logger -t echo -i -p daemon.info "< From=<>, ignored."
     rm $IN
     exit 0
else
     /usr/bin/logger -t echo -i -p daemon.info "< From=<$SENDER>"
fi

echo "From: Charite Echo <echo at charite.de>" > $OUT
echo "Subject: Re: $SUBJECT" >> $OUT
echo "To: $SENDER" >> $OUT
echo >> $OUT
cat <<EOT >> $OUT
You have successfully reached 

                      Charite Berlin, Germany

In case of problems please contact:
                                      Postmaster at charite.de

You may want to visit http://www.charite.de

------ This is a copy of your message, including all the headers. ------

EOT

sed 's/^/> /' $IN >> $OUT
echo >> $OUT
echo "  Automagically brought (back) to you by" >> $OUT
echo "                                         Charite Echo Processor" >> $OUT
 
# /usr/lib/sendmail -f"Echo-Daemon at TU-Berlin.DE" -t < $OUT
/usr/sbin/sendmail -t -f "" < $OUT
/usr/bin/logger -t echo -i -p daemon.info ">   to=<$SENDER>"
rm -f $IN $OUT
exit 0


Mehr Informationen über die Mailingliste Postfixbuch-users