tbac(_at_)IDT(_dot_)NET writes:
Hello, I use the following to extract and include "from"
in an autoreply, but I can't seen to get it to work
for "to".
FROM=`formail -rt -xTo:` # not sure if this is part of it or not.
echo "You are NOT on the approved list: $from";\
I want to do something like
echo" $to is not a valid user name";/
You need to be clearer about what you have versus what you want. Cutting
and pasting the relevant sections of your current .procmailrc are a good
start on the former.
I'll also note that variable names are case sensitive: $from will not
give you the expansion of the FROM variable.
Finally, when you say "to", what do you mean? Do you want the value of
the "To:" header field? Do you want the list of all the destination
addresses in the header? Or do you want the address that that *this*
particular message was sent to (i.e., the envelope address)? If you're
doing mail routing on it, then you almost 100% guaranteed want the last
of these, which you can't get without help from your MTA (e.g.,
sendmail).
Philip Guenther