$rc=time(); $stat=pop3stat($mbox); $nmsgs=$stat[msgs]; $rmsg=$msg; if(!isVirtual($uws_user)) { $disp=true; $hdr=pop3getheader($mbox,$msg+1); $to=$hdr[to]; } else { $vmsg=0; $disp=false; for($i=$nmsgs;($i>0)&&(!$disp);$i--) { $hdr=pop3getheader($mbox,$i); $to=$hdr[to]; if(bareEmail($hdr["received-for"])==$uws_user) { $vmsg++; if($vmsg==($msg+1)) { $disp=true; $msg=$i-1; } } } } $cc=$hdr[cc]; $from=$hdr[from]; $replyto=$hdr["reply-to"]; $subject=$hdr[subject]; $date=$hdr[date]; $message=pop3getmessage($mbox,($msg+1)); $parts=count($message); $disparts=0; for($i=0;$i<$parts;$i++) { $parthdrs[$i]=pop3extractheader($message[$i][hdr]); } if($parts>1) { $body=paraphrase($message[1][body],getUserPref($uws_user,"break")); if(strtoupper($parthdrs[1]["content-type"])!="TEXT/HTML") $body=htmlentities(paraphrase($body,getUserPref($uws_user,"break"))); $atts=$parts-2; } else { $body=$message[0][body]; if(strtoupper($parthdrs[0]["content-type"])!="TEXT/HTML") $body=htmlentities(paraphrase($body,getUserPref($uws_user,"break"))); $atts=0; } for($i=0;$i<$atts;$i++) { $parthdr=$parthdrs[$i+2]; $encoding=strtolower($parthdr["content-transfer-encoding"]); if(($encoding=="unquoted-printable")||($encoding=="quoted-printable")) { $dispart[$disparts]=$i+2; $disparts++; } } if($atts==$disparts) $atts=0; if($disp) { ?>
| ||||||||||||||
echo $body; ?>for($j=0;$j<$disparts;$j++) { $parthdr=$parthdrs[$dispart[$j]]; if(strtoupper($parthdr["content-type"])=="TEXT/HTML") { echo " ".$message[$dispart[$j]][body]."\n"; } else { echo " ".htmlentities($message[$dispart[$j]][body])."\n"; } } ?> |