Purposely bouncing selected mail?
karl_kleinpaste at charcoal.com
karl_kleinpaste at charcoal.com
Mon Sep 24 02:55:54 AEST 1990
jlol at remus.ee.byu.edu writes:
Let's suppose I'm on some junk mail mailing list that I haven't been
able to get off of. How can I make mail from that particular
person/list bounce or appear (convincingly) to have bounced without
having to change my email address?
The following suggestion is entirely untested, but the principle
should be reasonably obvious.
In .forward, place this:
\jlol, "|/home/dirs/jlol/bin/bouncer"
Then the bouncer script could look like...
----------------
#!/bin/csh -f
#
# Bouncer: a script to scan incoming mail to see if it comes
# from the "wrong" place, and fakes a bounce-o-gram back if so.
#
set t1=/tmp/bounce.a$$
set t2=/tmp/bounce.b$$
#
# Save the mail; then pull out the From_ address.
cat > $t1
set origin="`head -1 $t1 | awk '{ print $2 }'`"
#
# If it comes from the wrong place (hopefully, a *-request@* form)...
if ("$origin" == bad at addr.ess) then
#
# Bad juju. Preformat a pseudobounce-o-gram.
cat << EoF > $t2
To: $origin
Subject: Returned mail: User unknown
From: mailer-daemon at remus.ee.byu.edu
----- Transcript of session follows -----
554 jlol...User unknown
EoF
#
# Stuff it directly into sendmail.
(cat $t2 ; tail +2 $t1) | /usr/lib/sendmail -t
endif
#
# Clean up.
rm -f $t1 $t2
exit 0
----------------
Embellish to taste.
--karl
More information about the Comp.unix.admin
mailing list