function main_mail_headers(){
	$s=new mysql();
	$sql="SELECT header FROM `quarantine` WHERE MessageID='{$_GET["msgid"]}';";
	$ligne=mysql_fetch_array($s->QUERY_SQL($sql,"artica_backup"));
	$tpl=new templates();
	$ligne["header"]=htmlentities($ligne["header"]);
	$ligne["header"]=nl2br($ligne["header"]);
	
	$ligne["header"]=str_replace('X-SpamTest-Rate',"<strong style='color:red'>X-SpamTest-Rate</strong>",$ligne["header"]);
	$ligne["header"]=str_replace('X-SpamTest-Header',"<strong style='color:red'>X-SpamTest-Header</strong>",$ligne["header"]); 
	$ligne["header"]=str_replace('X-Spam-Score',"<strong style='color:red'>X-Spam-Score</strong>",$ligne["header"]); 	
	
	
	echo main_mailtabs()."<br>
	<H2>{$_GET["msgid"]}</H2>
	
	<div style='width:100%;overflow-y:auto;height:400px'><code>{$ligne["header"]}</code></div>";	
	
}
function ShowBackupMail()
{
    $page = CurrentPageName();
    $s = new mysql();
    $sql = "SELECT MessageBody FROM `storage` WHERE MessageID='{$_GET["ShowBackupMail"]}';";
    $ligne = mysql_fetch_array($s->QUERY_SQL($sql, "artica_backup"));
    if (preg_match('#Body-Begin-->(.+?)<\\!--X-Body-of-Message-End-->#is', $ligne["MessageBody"], $re)) {
        $ligne["MessageBody"] = $re[1];
    }
    if (preg_match('#<!--X-Head-of-Message-->(.+?)<!--X-Head-of-Message-End-->#is', $ligne["MessageBody"], $re)) {
        $head = $re[1];
        $ligne["MessageBody"] = str_replace($head, '', $ligne["MessageBody"]);
    }
    $ligne["MessageBody"] = str_replace("<h1>", "<h1 style='font-size:15px'>", $ligne["MessageBody"]);
    if ($_GET["tab"] == "header") {
        $ligne["MessageBody"] = $head;
    }
    $html = main_mailtabs() . "\n\t<div style='width:100%;overflow-y:auto;height:400px'>{$ligne["MessageBody"]}</div>";
    echo $html;
}
Beispiel #3
0
function ShowBackupMail()
{
    $page = CurrentPageName();
    $s = new mysql();
    $sql = "SELECT message_path, MessageSize FROM orgmails WHERE MessageID='{$_GET["ShowBackupMail"]}'";
    $ligne = mysql_fetch_array($s->QUERY_SQL($sql, "artica_backup"));
    $message_path = $ligne["message_path"];
    $message_size = $ligne["message_size"];
    $sql = "SELECT MessageBody FROM storage WHERE MessageID='{$_GET["ShowBackupMail"]}';";
    $ligne = mysql_fetch_array($s->QUERY_SQL($sql, "artica_backup"));
    if (preg_match('#Body-Begin-->(.+?)<\\!--X-Body-of-Message-End-->#is', $ligne["MessageBody"], $re)) {
        $ligne["MessageBody"] = $re[1];
    }
    if (preg_match('#<!--X-Head-of-Message-->(.+?)<!--X-Head-of-Message-End-->#is', $ligne["MessageBody"], $re)) {
        $head = $re[1];
        $ligne["MessageBody"] = str_replace($head, '', $ligne["MessageBody"]);
    }
    $ligne["MessageBody"] = CleanMail($ligne["MessageBody"]);
    if ($_GET["tab"] == "header") {
        $ligne["MessageBody"] = $head;
    }
    if ($message_path != null) {
        $sock = new sockets();
        $r = $sock->getfile("statfile:{$message_path}");
        if (!preg_match('#SUCCESS#', $r)) {
            $resend = Paragraphe('folder-64-fetchmail-grey.png', '{mail_backup_lost}', '{mail_backup_lost_text}');
        } else {
            $uid = $_SESSION["uid"];
            $user = new user($uid);
            $usr = new usersMenus();
            if ($usr->AsPostfixAdministrator) {
                $user->mail = "ask";
            }
            $js = "javascript:ResendSendMail('{$message_path}','{$user->mail}')";
            $tpl = new templates();
            $resend = "<div id='resendmail'>" . Paragraphe('folder-64-fetchmail.png', '{resend_mail}', '{resend_mail_text}<br>' . $user->mail, $js, "{resend_mail_text}") . "</div>";
            $resend = $tpl->_ENGINE_parse_body($resend);
        }
    }
    $html = main_mailtabs() . "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t<div style='width:600px;overflow:auto;height:400px;margin-top:5px;padding:5px;background-color:#F9F9F9;border:1px solid #CCCCCC'>\n\t\t{$ligne["MessageBody"]}\n\t</div>\n\t</td>\n\t<td valign='top'>{$resend}</td>\n\t</tr>\n\t</table>";
    echo $html;
}