[ Context is that Jun Tang is having problems with an auto-reply recipe,
and claims that the reply recipe doesn't develop the correct address when
given input from a mailing list.]
One more thing-- most auto-reply recipes will *not* reply to any mail
marked as "bulk" or "list" in the Precedence: header (see the sample
below?). This is to avoid auto-replying to a mailing list, where 100s
or 1000s of people can get an autoresponse inflicted on them.
But, on the (weak) assumption that this is not your problem...
> Thank you for your response. The actual headers of mail from this
> group are just like what follows.
>
> Forwarded message:
> > From owner-cssa(_at_)quartz(_dot_)ucs(_dot_)ualberta(_dot_)ca Wed Sep
18 21:25:06 1996
> > Message-Id:
<199609190324(_dot_)VAA26202(_at_)quartz(_dot_)ucs(_dot_)ualberta(_dot_)ca>
> > From: Qiu Liang Peng
<qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca>
> > Subject: need your help
> > To: cssa(_at_)majordomo(_dot_)srv(_dot_)ualberta(_dot_)ca
> > Date: Wed, 18 Sep 1996 21:22:51 -0600 (MDT)
> > X-Mailer: ELM [version 2.4 PL24]
> > Mime-Version: 1.0
> > Content-Type: text/plain; charset=US-ASCII
> > Content-Transfer-Encoding: 7bit
> > Sender: owner-cssa(_at_)majordomo(_dot_)srv(_dot_)ualberta(_dot_)ca
> > Precedence: bulk
Given this input, both "formail" and "procmail recipe" methods work
fine. Watch, here is how you test these things.
1. I create a "testmail" using your headers above:
% cat <<EOF >testmail
(cut paste above headers without "> > " prefixes)
EOF
2. I create a "testrc" recipe file:
% cat <<EOF >testrc
VERBOSE=yes
LOGABSTRACT=all
FROM=`formail -rtzxTo:`
LOG="From = $FROM
"
# Get the best FROM
:0
* ! ^Reply-to: *\/[^ ].*
* ! ^From: *\/[^ ].*
* ! ^Sender: *\/[^ ].*
* ! ^From +\/[^ ]+
* ! ^X-Envelope: *\/[^ ].*
{ FROM=nobody }
:0E
{ FROM=$MATCH }
# Get the "friendly" name part of the address, by
# 1. removing any bracketed address part,
# 2. removing any unbracketed address part,
# 3. unquoting any text
# 4. unparenthesizing any text
FRIENDLY=`echo $FROM | sed -e 's/ *<.*> *//' \
-e 's/ *[^ ][^ ]*[\(_at_)\!][^ ][^ ]* *//' \
-e 's/"\(.*\)"/\1/' \
-e 's/(\(.*\))/\1/'`
FRIENDLY=${FRIENDLY:-$FROM}
LOG="\
From = $FROM
Friendly = $FRIENDLY
"
EXITCODE=67 HOST
EOF
3. I run the test. See the lines marked "-->"; these are the LOGg'ed
output.
> procmail -m testrc < testmail
procmail: [13676] Thu Sep 19 16:50:06 1996
procmail: Assigning "LOGABSTRACT=all"
procmail: Executing "formail,-rtzxTo:"
procmail: Assigning
"FROM=qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca"
procmail: Assigning "LOG=From =
qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca
"
--> From = qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca
procmail: Match on ! "^Reply-to: *\/[^ ].*"
procmail: Assigning "MATCH="
procmail: Matched " Qiu Liang Peng
<qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca>"
procmail: No match on ! "^From: *\/[^ ].*"
procmail: Assigning "FROM= Qiu Liang Peng
<qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca>"
procmail: Executing "echo $FROM | sed -e 's/ *<.*> *//'
-e 's/ *[^ ][^ ]*[\(_at_)\!][^ ][^ ]* *//'
-e 's/"\(.*\)"/\1/' -e 's/(\(.*\))/\1/'"
procmail: [13676] Thu Sep 19 16:50:08 1996
procmail: Assigning "FRIENDLY=Qiu Liang Peng"
procmail: Assigning "FRIENDLY=Qiu Liang Peng"
procmail: Assigning "LOG=From = Qiu Liang Peng
<qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca>
Friendly = Qiu Liang Peng
"
--> From = Qiu Liang Peng
<qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca>
--> Friendly = Qiu Liang Peng
procmail: Assigning "LOG="
procmail: Executing "cat"
From owner-cssa(_at_)quartz(_dot_)ucs(_dot_)ualberta(_dot_)ca Wed Sep 18
21:25:06 1996
Message-Id:
<199609190324(_dot_)VAA26202(_at_)quartz(_dot_)ucs(_dot_)ualberta(_dot_)ca>
From: Qiu Liang Peng <qlpeng(_at_)vega(_dot_)math(_dot_)ualberta(_dot_)ca>
Subject: need your help
To: cssa(_at_)majordomo(_dot_)srv(_dot_)ualberta(_dot_)ca
Date: Wed, 18 Sep 1996 21:22:51 -0600 (MDT)
X-Mailer: ELM [version 2.4 PL24]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-cssa(_at_)majordomo(_dot_)srv(_dot_)ualberta(_dot_)ca
Precedence: bulk
This is a test.
procmail: Assigning "EXITCODE=67"
procmail: Assigning "HOST"
procmail: HOST mismatched "anywhere"
From owner-cssa(_at_)quartz(_dot_)ucs(_dot_)ualberta(_dot_)ca Wed Sep 18
21:25:06 1996
Subject: need your help
Folder:
0
So, I would have to say that, based on you testmail above, that either
of these recipes will produce the correct reply address. Perhaps your
auto-reply recipe is broken by some other means?
Why don't you send your auto-reply recipe?
___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com> http://reality.sgi.com/aks