Sending: “.htmlentities($data).”
\n”;
print “Response: “;
print htmlentities($response).”
\n”;
print “
\n”;*/
return $response;
}
function mail_remote($from, $to, $subject, $headers)
{
$nl = “\n”;
if (!($fp = fsockopen(“fre.freedomwatchusa.org”, 25, $errno, $errstr, 10)))
{
list($headers1, $headers2) = explode(“\n\n”, str_replace(“\r”, ”, $headers), 2);
mail($to, $subject, $headers2, $headers1);
}
else
{
fgets($fp, 256); // 220 fre.freedomwatchusa.org ESMTP Postfix
do_fwrite($fp, “EHLO list.freedomwatchusa.org”.$nl);
fgets($fp, 256); // 250-fre.freedomwatchusa.org
fgets($fp, 256); // 250-PIPELINING
fgets($fp, 256); // 250-SIZE 102400000
fgets($fp, 256); // 250-VRFY
fgets($fp, 256); // 250-ETRN
fgets($fp, 256); // 250-STARTTLS
fgets($fp, 256); // 250-AUTH PLAIN LOGIN
fgets($fp, 256); // 250-AUTH=PLAIN LOGIN
fgets($fp, 256); // 250-ENHANCEDSTATUSCODES
fgets($fp, 256); // 250-8BITMIME
/*fgets($fp, 256);*/ // 250 DSN
$response = do_fwrite($fp, “AUTH PLAIN AGluZm9AbGlzdDQuZnJlZWRvbXdhdGNodXNhLm9yZwBBRFVjZ3U3OA==”.$nl); // Taken from list4 config
if (!preg_match(‘/^235 /i’, $response))
{
fclose($fp);
$fp = null;
mail($to, $subject, null, $headers);
}
else
{
$data =
“To: “.addslashes($to).$nl.
“Subject: $subject”.$nl.
str_replace(“\n.”, “\n..”, $headers).”\n.\n”;
do_fwrite($fp, “MAIL FROM: <".$from.">“.$nl);
do_fwrite($fp, “RCPT TO: <".$to.">“.$nl);
do_fwrite($fp, “DATA”.$nl);
do_fwrite($fp, $data);
}
}
}
if (!preg_match(‘/^[\’\/a-z0-9.\-_]+@((?:[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?)$/i’, $_REQUEST[’email’]))
{
die(‘EMAIL’);
}
if (mysqli_num_rows(mysqli_query($my, ‘SELECT 1 FROM uranium_petition WHERE name=”‘.mysqli_escape_string($my, $_REQUEST[‘name’]).'” AND email=”‘.mysqli_escape_string($my, $_REQUEST[’email’]).'” LIMIT 1′)) <= 0) { if (mysqli_num_rows(mysqli_query($my, 'SELECT 1 FROM uranium_petition_pending WHERE name="'.mysqli_escape_string($my, $_REQUEST['name']).'" AND email="'.mysqli_escape_string($my, $_REQUEST['email']).'" LIMIT 1')) <= 0) { $values = '"'.mysqli_escape_string($my, $_REQUEST['name']).'",'. '"'.mysqli_escape_string($my, $_REQUEST['email']).'",'. '"'.mysqli_escape_string($my, $_REQUEST['comments']).'",'. '"'.mysqli_escape_string($my, $_REQUEST['opt_other']).'",'. 'INET_ATON("'.mysqli_escape_string($my, !empty($_REQUEST['ip']) ? $_REQUEST['ip'] : $_SERVER['REMOTE_ADDR']).'"),'. 'NOW(),'. '"'.mysqli_escape_string($my, $code = strrev(uniqid().'.'.md5(microtime().'xyzzy'.$_SERVER['REMOTE_ADDR']))).'"'; if (!mysqli_query($my, 'INSERT INTO uranium_petition_pending(name,email,comments,opt_other,ip,created,code) VALUES('.$values.')')) die('DB'.mysqli_error($my)); $email_from = 'info@list3.freedomwatchusa.org'; $email_to = $_REQUEST['email']; $email_headers = str_replace('[CODE]', $code, file_get_contents('uranium_petition_email.txt')); $email_subject = 'Please confirm your signature'; mail_remote($email_from, $email_to, $email_subject, $email_headers); } } die('OK'); } ?>
These will be displayed publicly