Subject: Re: Forcing a bounce?

From: [email-masked] (Bruce Perens)
Date: Mon, 6 Mar 95 11:24 PST

From: [email-masked] (John Yeates)
> Is it possible to use procmail to force a message to bounce, preferably
> with a custom message such as "Please do not send chain letters"?

Yes, I have a script that does this, though I haven't really had any
need to use it.

Here's the .procmailrc rule. I use the old syntax, but you can figure
it out.

	:1: $MAILDIR/bounce.lock
	^Received: from nasty-persons-address
	|/usr/people/bruce/Software/Bin.general/bouncemail

Here's the "bouncemail" script. I put in backslash-newline to break it
into shorter lines, the original is a one-line shell program.

	#!	/bin/csh -f
	(echo -n "From [email-masked] ";\
	/bin/date;echo "From: [email-masked]";\
	/bin/tee /usr/people/bruce/Software/Etc/Bounce.Last \
	|/usr/local/bin/formail -r -a "Subject: RETURNED BY SENDER";\
	/bin/cat /usr/people/bruce/Software/Etc/Bounce.txt \
	/usr/people/bruce/Software/Etc/Bounce.Last) | /usr/lib/sendmail -t

And here's Bounce.txt

	This is an automatic message. Your user name or site is on a list of
	annoyance mail senders. Your message has been automaticaly returned
	without delivery. Please desist in sending mail to this address.

		Thank You

		Bruce Perens

That should get you started.

	Bruce
--
Bruce Perens AB6YM 510-215-3502 [email-masked]

Attention Ham Radio Operators: For information on "Linux for Hams", read
the World Wide Web page http://www.rahul.net/perens/LinuxForHams