Yes, I just had that problem, it's actually not that hard to fix.
I just added this code right before the main error detection component:
$error = '';
........ get all the email form data
$ems = '';
// stop email server hacks
$ems .= $message;
$ems .= $subject;
$ems .= $address;
if ( stristr( $ems, 'content-type:' ) ¦¦ stristr( $ems, 'multipart/mixed' ) ¦¦ stristr( $ems, 'boundary="' ) ¦¦ stristr( $ems, 'cc:' ) ¦¦ stristr( $ems, 'multi-part message in mime format' ) ¦¦ stristr( $ems, 'to:' ) ¦¦ eregi( "(%[a-f0-9])", $ems ) ¦¦ stristr( $ems, '0x' ))
// the last two are in case they try using hex or other non standard characters
{
$error .= "<p>Don't bother</p>";
}
if ( $error )
{
echo $error;
}
else
{
...... finish email sending
Those guys are using what's called email injection, where they simply inject into your form fields using an automated bot extra header information so your script can be used to send out spam.
There are other ways to deal with it, this one seems to be working fine.
Replace the ¦¦ with standard pipe characters, not broken.
[ Message was edited by: lizardz 09/12/2005 04:46 pm ]
|