"") { // indentification incomming $login=$post_login; if ($_POST['post_location']=="") $location="Location: index.php?"; else $location="Location: $post_location?"; if ($login=="") { $error=1; $location=$location."errlogin=1&"; } if ($_POST['post_svr']<>"") $mailhost=$post_svr; else { $error=1; $location=$location."errsvr=1&"; } if ($_POST['post_password']<>"") $password=$post_password; else { $error=1; $location=$location."errpwd=1&"; } if ($error==1) { header($location); exit(); } $style=($post_style=="")? "classic.css" : $post_style; session_register('style'); session_register('login'); session_register('password'); session_register('mailhost'); $mailhostport=($post_svrport=="")? 110 : $post_svrport; session_register('mailhostport'); $mailsmtp=$post_smtp; session_register('mailsmtp'); $mailsmtpport=($post_smtpport=="")? 25 : $post_smtpport; session_register('mailsmtpport'); $smtpauth = ($post_auth=="auth"); session_register('smtpauth'); $spamfilter = ($post_spam=="spam"); session_register('spamfilter'); $friendfilter = ($post_friend=="friend"); session_register('friendfilter'); $ignorefilter = ($post_ignore=="ignore"); session_register('ignorefilter'); $refreshebiff=($post_refreshebiff=="")? 120 : $post_refreshebiff; session_register('refreshebiff'); } if ($spamfilter||$friendfilter||$ignorefilter) include("spam.inc"); include("format.inc"); $max_mail = 100; $max_car = 70; // Mail cols number include("fmail.php"); $mbox = @imap_open("{".$mailhost."/pop3:".$mailhostport."}", $login,$password); if ($mbox==FALSE) { header("Location: index.php?errcnx=1"); exit(); } // Retrieve number of mail $check = imap_mailboxmsginfo($mbox); if($check) { $lastchange=$check->Date; $total = $check->Nmsgs; $recent = $check->Recent; $unread = $check->Unread; $deleted = $check->Deleted; $mailboxsize = $check->Size; } function StringFormat($tmp) { global $max_car; $result=""; while (strlen($tmp)>$max_car) { $tmp2 = substr($tmp,0,$max_car); $result = $result.$tmp2; // if (strpos($tmp2,"\n") === false) $result= $result."¬\n"; if (strpos($tmp2,"\n") === false) $result= $result."\n"; $tmp = substr($tmp,$max_car,strlen($tmp)); } return $result.$tmp; } function displayAtt($att,$id) { if (!(strpos($att["type"],"image")===false)) $imgsrc="img"; elseif (!(strpos($att["type"],"audio")===false)) $imgsrc="snd"; else $imgsrc="none"; return " ".$att["name"] . " [" . $att["type"] . "] (" . ceil($att["size"]/1024) . " KB)  View Download"; } if ($action=="delete"&&isset($id)) { // Delete Message imap_delete($mbox, $id); imap_close($mbox, CL_EXPUNGE); header("Location: inbox.php"); exit(); }elseif ($action=="delete") { // Delete Group of Messages for($i=0;$i<=$nbmdel;$i++) { if ($mail[$i]!="") imap_delete($mbox, $mail[$i]); } imap_close($mbox, CL_EXPUNGE); header("Location: inbox.php"); exit(); } // end of del group of messages ?> WebMail
$printlogin : $total messages ("; // when you run for the first time ewiff, there no new message if (!isset($oldtotal)) $oldtotal=0; if (!isset($oldnewmsg)) $oldnewmsg=0; $newmsg = $total-$oldtotal; // when deleting email, there no new message, and old message decreasse if ($newmsg<0) { $newmsg =0; $oldtotal=$total; } if ($newmsg>0) { if ($newmsg>1) echo "$newmsg new messages"; else echo "$newmsg new message"; } else echo "No new message"; echo "  -  "; $oldmsg = $total-$newmsg; if ($oldmsg>0) { if ($oldmsg>1) echo "$oldmsg old messages"; else echo "$oldmsg old message"; } else echo "No old message"; $oldtotal=$total; session_register('oldtotal'); session_register('total'); $oldnewmsg=$newmsg; session_register('oldnewmsg'); echo ")"; ?>
"; echo ""; echo ""; echo ""; echo ""; echo "');\" onmouseout=\"kill();\" href=\"option.php\">(?)"; ?> 0)&&($nbm<=$max_mail); $x--,$nbm++) { $headers = imap_header($mbox, $x); if (isset($sortby)) { switch ($sortby) { case "size" : $structure = imap_fetchstructure($mbox, $x);$tmail[$x]=$structure->bytes;break; case "subject" : $tmail[$x]=strtolower($headers->Subject);break; case "from" : $tmail[$x]=strtolower($headers->fromaddress);break; case "to" : $tmail[$x]=strtolower($headers->toaddress);break; } } else $tmail[$x]=substr($headers->udate, 0, 22); } if (isset($rv)) if ($rv==1) arsort($tmail); else asort($tmail); else arsort($tmail); reset ($tmail); while (list ($x, $maildate) = each ($tmail)) { $headers = imap_header($mbox, $x); $structure = imap_fetchstructure($mbox, $x); $maildate= substr($headers->Date, 0, 22); $mailfrom = $mailfromaddr = ""; $elements=imap_mime_header_decode($headers->fromaddress); for($i=0;$icharset!="Default") $mailfrom=$mailfrom.$elements[$i]->text; } $begin = strpos($mailfrom, "<"); if (!($begin === false)) { $end = strpos($mailfrom, ">"); $mailfromaddr=substr($mailfrom,$begin,$end); $mailfrom=substr($mailfrom,0,$begin); } $mailfrom=htmlspecialchars($mailfrom); $mailid=$x; // correction for empty subject if ($headers->Subject == "") $mailsubject="No Subject"; else $mailsubject=$headers->Subject; $mailsize=ceil(($structure->bytes/1024)); $sections = parse($structure); $attachments = get_attachments($sections); if(is_array($attachments)) $mailatt=1; else $mailatt=0; $overview = imap_headerinfo($mbox,$x,0); if($overview->Recent=="N") $mailnew=1; else $mailnew=0; $classvalue=($spamfilter ? (checkSubject($mailsubject,$mailfrom." ".$mailfromaddr,false)? "spamsubject" : "all") : "all"); $classvalue=($ignorefilter ? (checkFromIgnore($mailfrom." ".$mailfromaddr,false)? "spamsubject" : $classvalue) : $classvalue); $classvalue=($friendfilter ? (checkFromFriend($mailfrom." ".$mailfromaddr,false)? "all" : $classvalue) : $classvalue); ?> > ?> >
  Up From Down Up Subject Down Up Date Down Up Size Down  
Delete "; ?> href="inbox.php?id="> Kb "; else echo " "?>
"; echo ""; echo ""; echo ""; echo ""; echo "');\" onmouseout=\"kill();\" href=\"option.php\">(?)"; ?>
This email don't exist !
OK
Date, 0, 22); $mailfrom = ""; $elements=imap_mime_header_decode($headers->fromaddress); for($i=0;$icharset!="Default") $mailfrom=$mailfrom.$elements[$i]->text; } $begin = strpos($mailfrom, "<"); if (!($begin === false)) { $end = strpos($mailfrom, ">"); $mailfromaddr=substr($mailfrom,$begin,$end); $mailfrom=substr($mailfrom,0,$begin); } $mailfrom=htmlspecialchars($mailfrom); $mailto=""; $elements=imap_mime_header_decode($headers->toaddress); for($i=0;$icharset!="Default") $mailto=$mailto.$elements[$i]->text; } $begin = strpos($mailto, "<"); if (!($begin === false)) { $end = strpos($mailto, ">"); $mailtoaddr=substr($mailto,$begin,$end); $mailto=substr($mailto,0,$begin); } $mailto=htmlspecialchars($mailto); $mailcc= imap_utf8 ( $headers->ccaddress); $begin = strpos($mailcc, "<"); if (!($begin === false)) { $end = strpos($mailcc, ">"); $mailcc=substr($mailcc,0,$begin); } else $mailcc=htmlspecialchars($mailcc); $mailid=$x; // correction for empty subject if ($headers->Subject == "") $mailsubject="No Subject"; else $mailsubject=$headers->Subject; $mailsize=ceil(($structure->bytes/1024)); if(sizeof($structure->parts) > 1) { $sections = parse($structure); $attachments = get_attachments($sections); } if(is_array($attachments)) $mailatt=1; else $mailatt=0; $overview = imap_headerinfo($mbox,$id,0); if($overview->Recent=="N") $mailnew=1; else $mailnew=0; ?> text/plain"; } $tmp=StringFormat(htmlspecialchars(stripslashes(trim(imap_qprint(imap_fetchbody($mbox, $id, $sections[$x]["pid"])))))); $mailcontent=$mailcontent.$tmp; if ($tmp!="") { if (!isset($htmltext)) $mailprintcontent=$mailprintcontent."
$tmp
\n"; else $mailprintcontent=$mailprintcontent.imap_qprint(imap_fetchbody($mbox, $id, $sections[$x]["pid"]))."\n"; } } } elseif ($sections[$x]["type"] == "text/html") { if (isset($full)) { $mailprintcontent=$mailprintcontent."
text/html
"; $mailprintcontent=$mailprintcontent."
";
			$tmp = htmlspecialchars(stripslashes(trim(imap_qprint(imap_fetchbody($mbox, $id, $sections[$x]["pid"])))));
      $mailprintcontent=$mailprintcontent.$tmp;
      $mailcontent=$mailcontent.$tmp;
      $mailprintcontent=$mailprintcontent."
\n"; } else { $tmp = imap_qprint(imap_fetchbody($mbox, $id, $sections[$x]["pid"])); $mailcontent=$mailcontent.$tmp; if ($tmp!="") { $htmlblock=1; // There an html block $mailprintcontent=$mailprintcontent."
"; $mailcontent=$mailcontent.$tmp; if (isset($html)) { $mailprintcontent=$mailprintcontent.$tmp; } elseif (isset($text)) { $mailprintcontent=$mailprintcontent."
".htmlspecialchars(stripslashes(trim($tmp)))."
"; } else { $mailprintcontent=$mailprintcontent."
!  HTML is not display, choose an option below
"; } $mailprintcontent=$mailprintcontent."
"; } } } elseif ($sections[$x]["type"] == "message/rfc822") { $mailprintcontent=$mailprintcontent."
"; if (isset($full)) { $mailprintcontent=$mailprintcontent."
message/rfc822
"; $mailprintcontent=$mailprintcontent."
";
			$tmp = htmlspecialchars(stripslashes(trim(imap_qprint(imap_fetchbody($mbox, $id, $sections[$x]["pid"])))));
      $mailcontent=$mailcontent.$tmp;
      $mailprintcontent=$mailprintcontent.$tmp;
      $mailprintcontent=$mailprintcontent."
\n"; } else $mailprintcontent=$mailprintcontent."
!  Type : message/rfc822 is not display, choose an option below
"; $mailprintcontent=$mailprintcontent."
"; } else { $mailprintcontent=$mailprintcontent."
"; $mailprintcontent=$mailprintcontent."
"; if (isset($full)) { $mailprintcontent=$mailprintcontent."
".$sections[$x]["type"]."
"; $mailprintcontent=$mailprintcontent."
";
			$tmp = htmlspecialchars(stripslashes(trim(imap_qprint(imap_fetchbody($mbox, $id, $sections[$x]["pid"])))));
      $mailcontent=$mailcontent.$tmp;
      $mailprintcontent=$mailprintcontent.$tmp;
      $mailprintcontent=$mailprintcontent."
\n"; } else { $mailprintcontent=$mailprintcontent."
!  Type : ".$sections[$x]["type"]." is not display, choose an option below
"; $mailprintcontent=$mailprintcontent.displayAtt($sections[$x],$id)."
"; } $mailprintcontent=$mailprintcontent."
"; } } } } else { if (isset($full)) { $mailprintcontent=$mailprintcontent."
".$sections[$x]["type"]." on ".$sections[$x]["disposition"]."
"; } $tmp = imap_body($mbox, $id); if ($tmp!="") { $mailcontent=$mailcontent.$tmp; if (!isset($htmltext)) //StringFormat(htmlspecialchars(stripslashes(trim(imap_qprint($tmp))))) $mailprintcontent=$mailprintcontent."
".StringFormat(htmlspecialchars($tmp))."
\n"; else $mailprintcontent=$mailprintcontent.$tmp."\n"; } } if ($spamfilter) { $spamresult = checkContent($mailcontent,false); if ($spamresult!=false) $isspam="spam"; else $isspam="all"; } //$isspam=($spamfilter ? (checkContent($mailcontent,false)? "spam" : "all") : "all"); echo ""; ?>
From: valign="top"> "; ?>
Date:
To: "; ?>
Copy to:
Subject: valign="top">
".(($isspam=="spam")? "
WARNING : This content was assimilited as SPAM
Found : \"$spamresult\"
" : "")."$mailprintcontent
Attachments: "; }?>