';
echo "
$iCount
Subject: $subject
\n";
$subject = trim(str_replace($subjectprefix, '', $subject));
if ($content_type == 'multipart/alternative') {
$content = explode('--'.$boundary, $content);
$content = $content[2];
$content = explode('Content-Transfer-Encoding: quoted-printable', $content);
$content = strip_tags($content[1], '
');
}
$content = trim($content);
echo "
Content-type: $content_type, boundary: $boundary
\n";
echo "
Raw content:
".$content.'';
$btpos = strpos($content, $bodyterminator);
if ($btpos) {
$content = substr($content, 0, $btpos);
}
$content = trim($content);
$blah = explode("\n", $content);
$firstline = $blah[0];
if ($use_phoneemail) {
$btpos = strpos($firstline, $phoneemail_separator);
if ($btpos) {
$userpassstring = trim(substr($firstline, 0, $btpos));
$content = trim(substr($content, $btpos+strlen($phoneemail_separator), strlen($content)));
$btpos = strpos($content, $phoneemail_separator);
if ($btpos) {
$userpassstring = trim(substr($content, 0, $btpos));
$content = trim(substr($content, $btpos+strlen($phoneemail_separator), strlen($content)));
}
}
$contentfirstline = $blah[1];
} else {
$userpassstring = $firstline;
$contentfirstline = '';
}
$blah = explode(':', $userpassstring);
$user_login = $blah[0];
$user_pass = $blah[1];
$content = $contentfirstline.str_replace($firstline, '', $content);
$content = trim($content);
echo "
Login: $user_login, Pass: $user_pass
";
$sql = "SELECT ID, user_level FROM $tableusers WHERE user_login='$user_login' AND user_pass='$user_pass' ORDER BY ID DESC LIMIT 1";
$result = mysql_query($sql);
if (!mysql_num_rows($result)) {
echo '
Wrong login or password.
';
continue;
}
$row = mysql_fetch_object($result);
$user_level = $row->user_level;
$post_author = $row->ID;
if ($user_level > 0) {
$post_title = xmlrpc_getposttitle($content);
$post_category = xmlrpc_getpostcategory($content);
if ($post_title == '') {
$post_title = $subject;
}
if ($post_category == '') {
$post_category = $default_category;
}
if ($autobr) {
$content = autobrize($content);
}
if (!$thisisforfunonly) {
$post_title = addslashes(trim($post_title));
$content = addslashes(trim($content));
$sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)";
$result = mysql_query($sql) or die('Couldn\'t add post: '.mysql_error());
$post_ID = mysql_insert_id();
if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
sleep($sleep_after_edit);
}
$blog_ID = 1;
rss_update($blog_ID);
pingWeblogs($blog_ID);
pingCafelog($cafelogID, $post_title, $post_ID);
pingBlogs($blog_ID);
pingback($content, $post_ID);
}
echo "\nPosted title: $post_title
";
echo "\nPosted content:
".$content.'
';
if(!$pop3->delete($iCount)) {
echo '
oops '.$pop3->ERROR.'
';
$pop3->reset();
exit;
} else {
echo "