procmail
[Top] [All Lists]

Re: handling multiple respondees

1996-07-28 10:08:07
I had written:

T>  ... formail -r [or -rt] extracts only one return address, even when
T> the Resent-Reply-To: or Reply-To: header contains more than one (and
T> Stephen has told me he plans to leave it that way).

Dan Smith responded,

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

I think he explained it to me when I asked him, but I didn't understand his
reason.

| Any suggestions on how to make this work?

| 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.

I posted a suggestion for that a long time ago (and Alan Stebbens has used
the same technique in one of his recipe libraries).  It was something like
the following, depending on a very useful quirk of procmail: if an extracting
expression matches but the condition doesn't because it's negated, $MATCH is
still set.

Note that it does not strip comments from addresses but hopes that the MTA
will know to ignore them when you send your response back out, and that any
leading spaces or tabs are extracted along with the visible data:

  :0 # list whatever headers you want in your personal order of precedence
  * ! ^Resent-Reply-To:\/.*
  * ! ^Reply-To:\/.*
  * ! ^From:\/.*
  * ! ^Resent-From:\/.*
  * ! ^Sender:\/.*
  * ! ^Resent-Sender:\/.*
  * ! ^Return-Path:\/.*
# ... whatever, ending with the last resort ...
  * ! ^From\/ +[^ ]+
  { } # or insert a routine for the case where no return address is extracted
  :0Efh
  | formail -r[t] -otheroptions -I"To:$MATCH"

Then again, if what you're sending is a non-delivery notice, you'll want to
give From_ a higher rank and in fact pretty much reverse the entire list.

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