www.pudn.com > umpl_xmail-2.11.rar > autoreply.sh


#!/bin/bash
#
# 	Simple AutoReply Script for use with Xmailserver 
#	(c)2001 TPS Developement.  
#	Written by Theo Rosbag  rosbag@thbird.org
#	modified by Achim Schmidt schmidt@waaf.net
#       This script will send a pre-defined message to the person wich sends you a message
#	
#
#
#
# These parameters must be modified for your needs
#
tmppath=/tmp # Path must exist on your system !!Do not end with a  /

XMAIL_ROOT=/var/MailRoot # Path where Xmailserver is located (not the binaries)

PATH=$XMAIL_ROOT/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

#
#
# The lines below doesn't need to be modified.

# Setting the environment
export MAIL_ROOT=$XMAIL_ROOT
set -e

if [ $2 != $1 ]
then

# Create a random Extension
ext=$RANDOM

# Create some temp. files
# Do not modify until you know what you're doing 
#

echo -n Date:>$tmppath/tmp.$ext
date --rfc >> $tmppath/tmp.$ext
echo "X-Mailer: TPS-AutoReply-v1.0.2-by-umpl_xmail" >>$tmppath/tmp.$ext
echo "Precedence: bulk" >>$tmppath/tmp.$ext
echo To:$2 >>$tmppath/tmp.$ext
echo Subject:$3 >>$tmppath/tmp.$ext
echo >>$tmppath/tmp.$ext
cat  $4 >> $tmppath/tmp.$ext
if [ $5 ]
then
echo >> $tmppath/tmp.$ext
echo >> $tmppath/tmp.$ext
echo >> $tmppath/tmp.$ext
echo On $(date --rfc) - $2 wrote: >> $tmppath/tmp.$ext
echo >> $tmppath/tmp.$ext
cat  $5 >> $tmppath/tmp.$ext
rm $5
fi
# send the message 
#
$XMAIL_ROOT/bin/sendmail -t -F$1 <$tmppath/tmp.$ext

# Remove temp files
#

rm $tmppath/tmp.$ext
fi