Ok I'm sorry but I don't get how to adapt that into my current script, but it does seem to contain the correct things, I'm sorry but could you have a go (I have been searching the forum but never found THAT post) I tired and annoyed and my brain has stopped working lol ....
Heres what I get into my inbox (raw)
From plazmay2k@yahoo.com Fri May 02 12:58:11 2003
Return-path: <plazmay2k@yahoo.com>
Envelope-to: roleplay@barnsleyclub.co.uk
Delivery-date: Fri, 02 May 2003 12:58:11 -0600
Received: from web20203.mail.yahoo.com ([216.136.226.58])
by megs11.100mwh.com with smtp (Exim 3.36 #1)
id 19BfjX-0004Wh-00
for roleplay@barnsleyclub.co.uk; Fri, 02 May 2003 12:58:11 -0600
Message-ID: <20030502190017.68008.qmail@web20203.mail.yahoo.com>
Received: from [62.30.112.1] by web20203.mail.yahoo.com via HTTP; Fri, 02 May 2003 12:00:17 PDT
Date: Fri, 2 May 2003 12:00:17 -0700 (PDT)
From: Mark Wood <plazmay2k@yahoo.com>
Subject: LOOOOOO
To: roleplay@barnsleyclub.co.uk
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-2018987153-1051902017=:66347"
X-Spam-Status: No, hits=0.9 required=5.0
tests=HTML_30_40,HTML_MESSAGE
version=2.53
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
--0-2018987153-1051902017=:66347
Content-Type: text/plain; charset=us-ascii
BOOOOOO
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
--0-2018987153-1051902017=:66347
Content-Type: text/html; charset=us-ascii
<DIV>BOOOOOO</DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/search/mailsig/*[url]http://search.yahoo.com[/url]">The New Yahoo! Search</a> - Faster. Easier. Bingo.
--0-2018987153-1051902017=:66347--
and heres my script;
#!/usr/bin/php -q
<?php
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
$lines = explode("\n", $email);
$from = "";
$subject = "";
$headers = "";
$message = "";
$splittingheaders = true;
for ($i=0; $i<count($lines); $i++) {
if ($splittingheaders) {
$headers .= $lines[$i]."\n";
if (preg_match("/^Subject: (.*)/", $lines[$i], $matches)) {
$subject = $matches[1];
}
if (preg_match("/^From: (.*)/", $lines[$i], $matches)) {
$from = $matches[1];
}
if (preg_match("/^MIME-Version: (.*)/", $lines[$i], $matches)) {
$headers = $matches[1];
}
if (preg_match("/^Content-type: (.*)/", $lines[$i], $matches)) {
$headers = $matches[1];
}
if (preg_match("/^X-Spam-Checker-Version: (.*)/", $lines[$i], $matches)) {
$headers = $matches[1];
}
if (preg_match("/^X-Spam-Level: (.*)/", $lines[$i], $matches)) {
$headers = $matches[1];
}
if (preg_match("/^X-Spam-Status: (.*)/", $lines[$i], $matches)) {
$headers = $matches[1];
}
} else {
$message .= $lines[$i]."\n";
}
if (trim($lines[$i])=="") {
$splittingheaders = false;
}
}
$link = mysql_connect("localhost", "user", "pass")
or die("Could not connect: " . mysql_error());
mysql_select_db("database") or die("Could not select database");
$query = mysql_query("SELECT count(email) from maillist where email='$from'");
$num = mysql_num_rows($query);
if ($num)
{
$query = mysql_query("SELECT email from maillist");
$num = mysql_num_rows($query);
while ($email = mysql_fetch_array($query) )
{
$to = $email["email"];
$header = "From: [email]someone@somehere.com[/email]\n";
$header .= "Reply-To: [email]someone@somewhere.com[/email]\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-type: text/html\n;";
$header .= "X-Priority: 1\n";
$header .= "X-MSmail-Priority: High\n";
$header .= "X-mailer: DAUMED\n";
mail("$to", "$subject", "$message", "$header");
}
}
else
{
mail("$from", "Unauthorised", "You are not authorised to post to this list...", "$header");
}
?>
Cheers in advance (sorry to be a burden!)