[dev] kolab::getMessageHeaders warnings

Duck duck at obala.net
Tue Mar 30 02:47:22 PST 2004


While wainting on kolab drivers I played with its current class.
While trying to get the imap messages at last shown in Nag, I noticed that  
getMessageHeaders functions produce warnings with messages I added trought 
kmail. This is why the function supposes that every header data is stored in 
one line. In the way "hname: hval". But some kmail headers data are spreaded 
in multiple lines. For example

Content-Type: text/calendar;
  method=REQUEST;
  charset="utf-8"

so I think that a consideration on combine headers in the way like below wont 
be a bad idea.

if ( strpos($headerline, ':') === FALSE ) {
	    
	     $hname = $hname_old;
	     $hval = MIME::decode($headerline);
	     $headers[trim($hname)] .= ' ' . trim($hval);
	     
} else {
	    
             list($hname, $hval) = explode(':', MIME::decode($headerline), 2);
	     $hname_old = $hname;
	     $headers[trim($hname)] = trim($hval);
	     
}


More information about the dev mailing list