[SpamCop.net - protecting the internet through technology]

[SpamCop-List] Re: donating e-mail addresses exclusively receiving spam

Steven Maesslein nobody at nowhere.invalid
Fri Feb 25 11:00:46 EST 2005


On Thu, 24 Feb 2005 23:14:50 -0500, Alex coughed into spamcop and left
this in <cvm8nq$bf$1 at news.spamcop.net>:

> I have sendmail configured to automatically forward any e-mails....

There's your problem.

You should wrap the inbound mail in a new MIME structure and send *that* 
off. I use this perl script to do just that and it's been working fine 
for a couple of years now. Note that it relies on the GNU version of 
'date' which allows the '-R' switch to get an RFC822-compliant date 
header:



#!/usr/bin/perl -w

my $RECIPIENT    = "submit.[sekrit_code]\@spam.spamcop.net";
my $SENDER       = "your_e-mail\@ddress";
my $BOUNDARY     = "djfqmlsdfmlqkdmljqmfljsdlkfjqlsdjflmqsjdfmlkqjsmdlfjqlmksdjfsj";
my $CANSEND      = 1;
my $SENDMAILCMD  = "/usr/sbin/sendmail -t -i -f$SENDER";
my $SENDMAIL;

open (my $DATEFD, "/usr/bin/date -R |") or $CANSEND = 0;

if ( $CANSEND ) {
  my $DATE = <$DATEFD>;
  chomp($DATE);
  close($DATEFD);

  open ($SENDMAIL, "| $SENDMAILCMD") or $CANSEND = 0;

  if ( $CANSEND ) {
    print $SENDMAIL "From: <$SENDER>\n";
    print $SENDMAIL "To: <$RECIPIENT>\n";
    print $SENDMAIL "Date: $DATE\n";
    print $SENDMAIL "Subject: reply anyway\n";
    print $SENDMAIL "Content-Type: multipart/mixed; boundary=\"$BOUNDARY\"\n";
    print $SENDMAIL "MIME-Version: 1.0\n\n";

    print $SENDMAIL "This mail is MIMEified.\n\n";

    print $SENDMAIL "--$BOUNDARY\n";
    print $SENDMAIL "Content-Type: text/plain; charset=\"us-ascii\"\n";
    print $SENDMAIL "Content-Transfer-Encoding: 7bit\n\n\n\n";

    print $SENDMAIL "--$BOUNDARY\n";
    print $SENDMAIL "Content-Type: message/rfc822\n";
    print $SENDMAIL "Content-Disposition: inline\n";
  }

}

while ( <STDIN> ) {
  print $SENDMAIL "$_" if ( $CANSEND );
}

if ( $CANSEND ) {
  print $SENDMAIL "\n--${BOUNDARY}--\n";
  close($SENDMAIL);
}



-- 
Steve

Sign spotted in an office:
AFTER TEA BREAK STAFF SHOULD EMPTY THE TEAPOT
AND STAND UPSIDE DOWN ON THE DRAINING BOARD


More information about the SpamCop-List mailing list