Paul
08-11-2003, 10:00 PM
Hi,
This is a simple modification that seems to be a lacking feature in the default installation of vBulletin. As such, I'm offering a temporary solution here.
While a better approach may be to incorporate a "blacklist" for e-mail addresses to prevent e-mails from being processed to specific addresses, this solution offers simple checking for the send-to-friend form to ensure e-mails sent using that form cannot be processed to the existing banned e-mail address list in vBulletin for registration.
This is being used by us to complement existing modifications and site policy. Room for improvements are discussed below.
If you ban things like webmail domains from using your system, this may not be a hack you wish to install.
Places where this hack could be improved:
Check all outgoing e-mails via vbmail() function
Create separate list of addresses from registration ban list.
Include automated "opt-out" form for users to stop e-mails from being sent automatically.
Code modifications are simple:
In sendtofriend.php, FIND:
eval("\$message = \"".gettemplate("email_sendtofriend",1,0)."\";");
Below, INSERT:
// Hack: Do not let send-to-friend e-mails be sent to banned e-mail addresses
$email = trim($sendtoemail);
if ($enablebanning and $banemail!="") {
if (stristr(" ".$banemail." "," ".$email." ")!="") {
eval("standarderror(\"".gettemplate("error_banemail")."\");");
exit;
}
if ($emaildomain=substr(strstr($email,"@"),1)) {
if (stristr(" ".$banemail." "," ".$emaildomain." ")!="") {
eval("standarderror(\"".gettemplate("error_banemail")."\");");
exit;
}
}
}
// End hack: Do not let send-to-friend e-mails be sent to banned e-mail addresses
This is a simple modification that seems to be a lacking feature in the default installation of vBulletin. As such, I'm offering a temporary solution here.
While a better approach may be to incorporate a "blacklist" for e-mail addresses to prevent e-mails from being processed to specific addresses, this solution offers simple checking for the send-to-friend form to ensure e-mails sent using that form cannot be processed to the existing banned e-mail address list in vBulletin for registration.
This is being used by us to complement existing modifications and site policy. Room for improvements are discussed below.
If you ban things like webmail domains from using your system, this may not be a hack you wish to install.
Places where this hack could be improved:
Check all outgoing e-mails via vbmail() function
Create separate list of addresses from registration ban list.
Include automated "opt-out" form for users to stop e-mails from being sent automatically.
Code modifications are simple:
In sendtofriend.php, FIND:
eval("\$message = \"".gettemplate("email_sendtofriend",1,0)."\";");
Below, INSERT:
// Hack: Do not let send-to-friend e-mails be sent to banned e-mail addresses
$email = trim($sendtoemail);
if ($enablebanning and $banemail!="") {
if (stristr(" ".$banemail." "," ".$email." ")!="") {
eval("standarderror(\"".gettemplate("error_banemail")."\");");
exit;
}
if ($emaildomain=substr(strstr($email,"@"),1)) {
if (stristr(" ".$banemail." "," ".$emaildomain." ")!="") {
eval("standarderror(\"".gettemplate("error_banemail")."\");");
exit;
}
}
}
// End hack: Do not let send-to-friend e-mails be sent to banned e-mail addresses