#!/bin/sh DATE=`date +"%m-%d-%y-%H-%M-%S"` WORK="$HOME/work" AR_MAIL_IN="./ar-mail-in" # # Store the interesting headers + body to a temp file # cat - | formail -k -X From: -X Subject: -X Date: -X To: -X Reply-To: \ -X Message-Id: >$WORK/AR-$DATE.$$ || exit 1 # # extract headers for action request # FROM=`formail -x From: < $WORK/AR-$DATE.$$` REPLYTO=`formail -x Reply-To: < $WORK/AR-$DATE.$$` SUBJECT=`formail -x Subject: < $WORK/AR-$DATE.$$` #./foobar -m $WORK/AR-$DATE.$$ -f "${FROM:-none}" \ # -r "${REPLYTO:-none}" -s "${SUBJECT:-none}" # # submit to remedy # $AR_MAIL_IN -S -m $WORK/AR-$DATE.$$ -f "${FROM:-none}" \ -r "${REPLYTO:-none}" -s "${SUBJECT:-none}" || exit 1 echo "return = $?" > /tmp/out2 rm -f $WORK/AR-$DATE.$$ exit 0