procmail
[Top] [All Lists]

auto-responding to wrong numbers

1998-10-01 17:29:44
I have my own vanity domain, and I wind up getting a lot of "wrong numbers"
when people with similar domain names give their e-mail addresses out
incorrectly (or even enter them incorrectly in their mail clients).

One major culprit here is customers of crosswinds.net. All crosswinds
addresses are in the form 
[login](_at_)[cityname](_dot_)crosswinds(_dot_)net(_dot_) So when one of
this gets mis-addressed to me, there is always a dot before crossroads.net.
This makes for a convenient matching condition.

What I want to do is auto-respond to these messages with a note that says
"try crosswinds.net" , then the mistaken e-mail address (or barring that,
the whole header) and then quote back the original message..

Here's the recipe I'm working on:

: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

What this results in is a quote-back of the original message followed by my
message. So I'm getting there...

Eventually, I will probably try to create a more generalized handler for
wrong numbers, but this is a special case where it is easy to identify the
nature of the mistake, so I want a special handler for it.

Thanks in advance for any input.

    Adam Rice |  adamrice(_at_)crossroads(_dot_)net  | Check out
Austin TX USA | http://www.crossroads.net | XJ: Translation Jobs

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