[6180] in RedHat Linux List
Re: spam, probably not from this list
daemon@ATHENA.MIT.EDU (Steve \"Stevers!\" Coile)
Tue Nov 26 09:01:15 1996
Date: Tue, 26 Nov 1996 08:57:39 -0500 (EST)
From: "Steve \"Stevers!\" Coile" <scoile@patriot.net>
To: drink <drink@cloud9.net>
cc: redhat-list@redhat.com
In-Reply-To: <329A7DAB.F08@cloud9.net>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
On Tue, 26 Nov 1996, drink wrote:
> > In a rather unusual twist, the last email spam I received from the
> > elusive "emerald@earthstar.com" was advertising software to assist in
> > email spamming. So is that spam^2?
> >
>
> I'm on this one list, and I don't post anywhere else. emerald got our
> addies from here. If anyone writes a short script that will hurry off a
> few hundred thousand email messages to spammers like that I for one will
> run it, I think I got a few messages from emerald so maybe I'll run it a
> few times (maybe I'll put it in my crontab for 3am for a few weeks :)
This script doesn't "hurry off a few hundred thousand email messages to
spammers", but I use it to complain. If you use Pine to read your mail,
simply hit the "|" key and enter the command to invoke this script. If
anyone can offer any improvements, please post 'em! Note that this was
written for use on a Digital UNIX system.
#!/usr/local/bin/perl
# Change the above to /usr/bin/perl on RHL systems.
# Location of the "sendmail" executable.
$SENDMAIL = "/usr/sbin/sendmail";
# Your local domain. Complaints are not sent to hosts within this domain.
$MYDOMAIN = "gmu.edu";
@header = ();
@host = ();
# Cull host addresses from message header. We'll send complaints to
# abuse@ and postmaster@ at all sites we can find.
while (<>) {
push(@header,$_);
chomp;
if (
(/^Comments: Authenticated sender is .*@([-_+.0-9A-Za-z]+)/) ||
(/^From: .*@([-_+.0-9A-Za-z]+)/) ||
(/^Message-Id: .*@([-_+.0-9A-Za-z]+)/) ||
(/^Received: from ([^ ]+)/) ||
(/^To: .*@([-_+.0-9A-Za-z]+)/)
) {
my(@h) = split(/\./,$1);
$h = join(".",@h[($#h - 1),$#h]);
push(@host,$h);
} elsif (/^$/) {
last;
};
};
# Remove references to hosts within our domain, sort and collapse
# the list.
{ my(@newhost) = ();
my($prev) = "";
foreach (sort(@host)) {
push(@newhost,$_)
if (($_ ne $prev) && ($_ ne $MYDOMAIN));
$prev = $_;
};
@host = @newhost;
};
# Generate the list of addresses to which complaints will be sent.
@recipient = ();
foreach (@host) {
push(@recipient,"abuse\@$_");
push(@recipient,"postmaster\@$_");
};
# Generate and send the complaint message.
if (open(MSG,"|$SENDMAIL " . join(" ",@recipient))) {
print(MSG "Subject: unwelcome, unsolicited advertisement\n");
print(MSG "To: ",join(",",@recipient),"\n");
print(MSG "\n");
print(MSG "Unsolicited advertisements are unwelcome.\n\n");
# Remove the following block if you don't want your signature included.
if (open(SIG,$ENV{"HOME"} . "/.signature")) {
while (<SIG>) {
print(MSG $_);
};
close(SIG);
print(MSG "\n");
};
# Remove the preceeding block if you don't want your signature included.
print("---------- Original message follows ----------\n");
foreach (@header) {
print(MSG $_);
};
while (<>) {
print(MSG $_);
};
close(MSG);
print("Message sent to ",join(" ",@recipient),"\n");
};
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null