procmail
[Top] [All Lists]

Re: auto-responding to wrong numbers

1998-10-02 16:47:07
Adam Rice wrote,

| :0
| # without that .*, the next line doesn't work
| * ^TO_.*\.crossroads\.net
| *!^FROM_DAEMON
| *!^X-Loop:errors(_at_)crossroads(_dot_)net
| |(formail -rk -a "Precedence: bulk" \
| -I"From: the Crossroads Error-bot <errors(_at_)crossroads(_dot_)net>" \
| -I"Subject: Mistaken e-mail to Crossroads.net" \
| -A "X-Loop: errors(_at_)crossroads(_dot_)net";\
| echo "You have mistakenly sent e-mail to crossroads.net";\
| echo "Your intended recipient is really at crossWINDS.net";\
| # The next line results in an error
| -x "To:";\
| echo "Please make a note of it" ) | $SENDMAIL -t -oi

If you had the -x line there where you illustrated it, I don't quite
understand.  -x is not a command that the shell can execute, so it will
cause an error.  (Also, if the comment line were there in his rcfile and
isn't just something he added for his post to tell us the problem, it
would have marked the end of the action line and procmail would have
expected a variable assignment or a new recipe next.)

If '-x "To:"' were up higher amid the formail options, it would present
a different problem.  -x and -X pretty much override everything else and
result in just extraction of the named headers (with -X) or the contents
of the named headers (with -x), losing all the rest of them.  So if it
were amid the formail options, the only thing output by formail would be
the contents of the To: header [as rewritten by -r, so it would be the
sender's address] and, because of -k, the body of the incoming message.

| What this results in is a quote-back of the original message followed by my
| message.

Yup ... with the recipient's address at the top.  And it's not valid input
to $SENDMAIL, so it doesn't do the whole job.

I'd say drop the -x stuff.

Now, Adam, are you trying to insert the advice to try crosswinds.net between
the header lines of the response and the returned body of the incoming
message?  Did you want to return the headers of the incoming message as well?

The answers to all those questions affect the final code, so I don't want
to try my hand at it until I know exactly what you want.

In a similar position, I return the subject and the body, but you might want
to do it differently.

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