Some mails are encoded in bad quoted printable format:
I use this function to decode the qprint:
for($i=0;$i<256;$i++)
{
$c1=dechex($i);
if(strlen($c1)==1){$c1="0".$c1;}
$c1="=".$c1;
$myqprinta[]=$c1;
$myqprintb[]=chr($i);
}
function decode($data,$code)
{
if(!$code){return imap_utf7_decode($data);}
if($code==0){return imap_utf7_decode($data);}
if($code==1){return imap_utf8($data);}
if($code==2){return ($data);}
if($code==3){return imap_base64($data);}
if($code==4){return imap_qprint(str_replace($myqprinta,$myqprintb,($data)));}
if($code==5){return ($data);}
}