DW,
Please check your code, this new code did NOT work for me, even though the old code worked just fine! I tested it many ways, but I can tell you this, the old code runs fine and takes about 5-6 seconds to process, the new code runs immediately (1 second), reports no errors, and does NOT send an email notifying me, nor does it remove the invalid User ID.
Another thing to note, when running the test, you MUST find the UserID (UID field), and NOT the ID field. Here is how you test it. You must create a test file, call it 'aoltest.txt', mine is below:
From: <scomp@aol.net>
http://mydomain.com/mail/rem.php?u=ef9b530
Make sure you replace mydomain.com with your own domain, AND that you go into PhpMyAdmin and locate a test email address you want to remove - after locating a test address, do a browse and find that address in your MySQL database, then replace the 'ef9b530' shown above with the UID column that shows in your MySQL database for the user you want to do a 'test remove' - make sure that user has a CNF field of '1' (active) - otherwise the remove will not work and report an error (to your email address) that the user is not in the database.
Then, save it as ASCII text file and upload it to the folder you will place the aolnotify.pl script (shown below). Then Login to your shell account and enter this at the command prompt (from the folder where you have placed the aolnotify.pl file):
./aol-notify.pl < ./aoltest.txt
You should receive an email address in the address you specified indicating that the user has been removed (see below - replace aolnotify\@mydomain.com with the email address you want to be notified at at your own domain. You can also verify that it removed the address by reloading the MySQL database in PhpMyAdmin and looking for the email address that you used (in aoltest.txt), after you locate it, the CNF field should be changed to '2' if that address was successfully removed.
For anyone looking, here's the 'old code' (aolnotify.pl) that I used that worked:
#!/usr/bin/perl -w
# config
$my_email = "aolnotify\@mydomain.com";
# get piped message
$em = '';
$hd = '';
while($l=<>){
$em = $em . $l;
if((index($l,'From: ')!=-1 && index($l,'scomp@aol.net')==-1) || (index($l,'To: ')!=-1 && index($l,'Delivered-To:')==-1) || index($l,'Subject: ')!=-1){
$hd = $hd . $l;
}
if(index($l,'rem.php?')!=-1){
# print "l [$x]: $l"."l [$x]: 0123456789012345678901234567890123456789012345678901234567890123456789\n";
$rl = $l;
$rl = substr $rl, index($rl,'http://');
$epos = index($rl,'"');
if($epos==-1){ $epos = index($rl,' '); }
if($epos==-1){ $epos = index($rl,"\n"); }
if($epos==-1){ print "eol not found.."; return 1; }
$rl = substr $rl, 0, $epos;
$rl =~ s/=3D/=/g;
$rl =~ s/\&/\\\&/g;
}
}
$qstr = "\nFrom: <scomp\@aol.net>";
$apos = index($em,$qstr);
if($apos!=-1){
if(!$rl){
#print "AOL spam complaint but NO REMOVE LINK... $hd";
exit;
}
#print "AOL SPAM COMPLAINT - Remove Link FOUND! $rl\n";
sub rsgen{
my $rslen=shift;# the length of
my @ch=('a'..'z','A'..'Z','0'..'9','_');
my $rs;
foreach (1..$rslen){ $rs.=$ch[rand @ch]; }
return $rs;
}
my $rs=&rsgen(8);
$cmd = "curl -o /tmp/aol$rs $rl\\&dodel=1 \> /dev/null 2\> /dev/null";
#print "\ncmd=$cmd\n";
system($cmd);
sleep(5);
$cmd = "mail -s \"AOL Complaint Processed\" $my_email < /tmp/aol$rs";
system($cmd);
system("rm -rf /tmp/aol$rs");
}
After you test it, report if it works, than try it with the new version DW has updated, does it work for that version too? I can't get the new version to work for me...
Any ideas DW?