procmail
[Top] [All Lists]

Re: auto-replying -- sending back the _headers_

1997-03-30 14:14:08

I need to maintain the original From field.  (the From: remains in tact)  I
forward it to a different service and need an autoreply from the new service to
be generated. Parcing the From: is prone to error due to the many different
formats that we receive.

I would appreciate any help configuring this.

Thank you

Kair


 From: "J. Daniel Smith" <DanS(_at_)bristol(_dot_)com>, on 3/27/97 9:15 AM:
 To: rsr(_at_)aonix(_dot_)com
 Cc: luomat(_at_)peak(_dot_)org, 
procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
 
 Roy Rapoport writes on 26 March 1997 at 19:52:15
 >
 >On March 26, 1997, "Timothy J. Luoma" <luomat(_at_)peak(_dot_)org> said:
 >>
 >>I am helping a few people debug their sendmail configs.  They are  
 >>trying to make sure all their headers are in the right order, etc.
 >>
 >>I would like to be able to setup a thing where they could send me a  
 >>message with a certain subject and get an automated response -- but  
 >>[...]
 
 Here's my solution...it uses an alias I call "loopback".
 
    Dan
 ------------------- message is author's opinion only ------------------
 J. Daniel Smith <DanS(_at_)bristol(_dot_)com>        
http://www.bristol.com/~DanS
 Bristol Technology B.V.                   +31 33 450 50 50, ...51 (FAX)
 Amersfoort, The Netherlands               {info,jobs}(_at_)bristol(_dot_)com
 -----
 # 
 # J. Daniel Smith
 # 1 May 1996
 #
 # loopback.rc - bounce a message back to the sender
 #
 
 #####
 ##### Initial setup needed for *all* procmail invokations
 #####
 PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin
 SHELL=/bin/sh
 
 MAILDIR=/tmp
 
 # log everything verbosely, since I want to see how all this works
 # this needs to be near the beginning of the file to turn logging on ASAP
 #LOGFILE=$MAILDIR/LOG
 #VERBOSE=on
 
 # define the local top-level domain and fully-qualified domain names
 DOMAIN=bristol.com
 FQDN=${DOMAIN}
 
 #####
 ##### Extract/generate interesting mail headers
 #####
 # get the date in RFC822 format for insertion into some messages;
 # the "Resent-Date:" field is copied from the "Date:" field on some systems.
 # RFC1123 says "All mail software SHOULD use 4-digit years in dates..."
 # sun4 doesn't recognize all "date" flags
 #year=`date '+%y'`
 #DATE=`cent=19; if [ $year -lt 70 ]; then cent=20; fi; date "+%a, %d %h 
 $cent%y %T EST"`
 DATE=`date '+%a, %d %h %Y %H:%M:%S %Z'`
 
 # prevent mail loops
 :0
 * ^FROM_DAEMON
 /dev/null
 
 # large messages are simply bounced back; 69 = EX_UNAVAILABLE
 TRAP="exit 69;"
 EXITCODE=69
 :0
 * > 7000
 /dev/null
 EXITCODE=0
 TRAP=""
 
 HOSTNAME=`hostname`
 :0c:
 loopback.$$
 :a
 |(formail -rt \
           -I "Reply-To: Postmaster(_at_)$DOMAIN" \
       -I 'Precedence: junk' \
           -I 'MIME-Version: 1.0' \
           -I 'Content-Type: multipart/mixed; boundary="-- next item ----"'; 
 \
   echo "This is the preamble of an RFC-1521 encoded, mixed message."; \
   echo "---- next item ----"; \
   echo "Content-Type: text/plain"; \
   echo "Context-Description: bristol.txt"; \
   echo ""; \
   echo "Your message was received at $DOMAIN on $DATE"; \
   echo "Bristol Technology is the leading supplier of cross-platform"; \
   echo "development solutions, including Wind/U, HyperHelp and XPrinter."; \
   echo "For details, visit our WWW site at http://www.bristol.com";; \
   echo ""; \
   if [ "$HOST" != "" ]; then \
     echo "This machine ($HOST) is located at the Bristol offices:"; \
   else \
     echo "This machine ($HOSTNAME) is located at the Bristol offices:"; \
   fi; \
   echo "41.28N -73.45W; 241 Ethan Allen Hwy, Ridgefield, CT; +1 203 438 
 6969"; \
   echo ""; \
   echo "Questions about this message should be sent to 
postmaster(_at_)$DOMAIN"; 
 \
   echo "---- next item ----"; \
   echo "Content-Type: message/rfc822"; \
   echo "Context-Description: bounce.txt"; \
   echo ""; \
   formail -I "From " < $MAILDIR/$LASTFOLDER; \
   echo "---- next item ------"; \
   ) | ($SENDMAIL -t; rm -f $MAILDIR/$LASTFOLDER)
 
 # don't want to save any messages away
 :0
 /dev/null
 
 

Kari Larson
larsonk(_at_)ix(_dot_)netcom(_dot_)com
http://www.netmind.com/~larsonk