procmail
[Top] [All Lists]

Re: handling multiple forwardees

1996-07-28 04:09:34
David W. Tamkin writes on 27 July 1996 at 18:48:54
[...]
It requires a lot of processes and gives meaningless results, because formail
-r extracts only one return address, even when the Resent-Reply-To: or
Reply-To: header contains more than one (and Stephen has told me he plans to
leave it that way).  So unless there is also a non-empty Cc: header, it will

Ah!  This explains why my loopback.rc recipe didn't work as I
expected the other day.  I'm sure Stephen has a good reason for this,
maybe he has the time to explain it?

Any suggestions on how to make this work (loopback.rc appended below,
it's running on a machine with a fairly old version of procmail)?
This recipe is invoked via the following alias
   loopback: "|/usr/local/bin/procmail /etc/mail/loopback.rc"
Last week I wanted the auto-response to go to several people,
so I listed all of them (including myself) in the Reply-To: header; I
never saw the auto-response message.

   Dan
------------------- message is author's opinion only ------------------
J. Daniel Smith <DanS(_at_)bristol(_dot_)com>        http://www.bristol.com/~dan
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

<Prev in Thread] Current Thread [Next in Thread>