Christopher,
No, you didn't - I did! I removed the script from ListMail due to the fact that it is unreliable and can cause you complaints. I found people frequently subscribing using a catch-all address that cannot be easily sent "From". In the interest of everyone's benefit I removed the script, however here it is if you want to use it!
#!/usr/bin/perl
# ListMail remove.cgi - Unsubscribe by email.
#
# You must configure this script for it to work.
#
# Place the script in your "public_html/cgi-bin" directory. You may need multiple copies of
# this script with different filenames / email alias addresses if you want to remove users from
# individual lists or different sets of lists. Alternately, you can just specify all and the
# user will be removed from all lists with 1 email.
# SET this to your ListMail URL, NO trailing slash
$listmail_url = "http://www.DOMAIN.com/mail";
# SET the variable $list to one of the following:
# single list
# $list = '1';
# multiple lists
# $list = '1,3,2';
# all lists (default)
$list = 'all';
# usually works as default (may be /usr/local/bin/wget or other)
$http_program = "/usr/bin/wget -O - " . $listmail_url . "/remove.php";
# begin script
# encode function
sub encode {
my $str = shift || '';
$str =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg;
$str;
}
# get piped message
$email = '';
while($line=<>){
$email = $email . $line;
}
if($email){
# process msg, grab email address and first / last name, if possible
# find To:
$searchstr = 'From: ';
$strpos = index($email,$searchstr);
if($strpos>=0){
$thestr = substr($email,$strpos+length($searchstr),length($email));
$npos = index($thestr,"\n");
if($npos>=0) {
# get email
$thestr = substr($thestr,0,$npos);
$lbpos = index($thestr,'<');
if($lbpos>=0){
$rbpos = index($thestr,'>');
$em = substr($thestr,$lbpos+1,$rbpos-$lbpos-1)
} else {
$justmail = 1;
$em = $thestr;
}
# check for name spaces
$spos = index($thestr,' ');
if($spos>=0) { $justmail = ''; } else { $justmail = 1; }
if($justmail ne 1){
# get name
$name = substr($thestr,0,$lbpos-1);
# strip quotes
$name =~ s/\"//g;
$spos = index($name,' ');
if($spos>=0){
$fn = substr($name,0,$spos);
$ln = substr($name,$spos+1,length($name)-$spos-1);
}
}
# sign up
$sys_cmd = $http_program . "\\?cgi=1\\&list=$list\\&email=$em";
if($fn ne '') { $sys_cmd = $sys_cmd . "\\&fname=$fn"; }
if($ln ne '') {
$ln = encode($ln);
$sys_cmd = $sys_cmd . "\\&lname=$ln";
}
system($sys_cmd . " > /dev/null 2> /dev/null");
# notify in php
}
}
}
Regards