Content copyright © 2006-2007 by eZ systems A.S.
|
|
|
|
Description:
I use the ezComponent 'Mail' to save mails into a database including headers. However, in case of multiple headers with the same headername, only the last entry is accessible (through method generateHeaders). This is very unfortunate, since in case of the 'Received'-headers I cannot determine which servers are passed until the mail was delivered (for each passed SMTP server a 'Received' header is created). I solved this by changing the method 'parseHeader' of class 'part_parse.php'. I added the following code right under linenumber 179. $counter = null;while(isset($headers[$matches[0][1].$counter])) { if(empty($counter)) $headers[$matches[0][1].$counter] = str_replace( "\t", " ", trim( $matches[0][2] ) ); An example of the result of 'echo $mail->generateHeaders()' for only Received-headers: Received: from relay.n01.nxs.nl (217.115.192.39) by EXCHANGEMULTI.exchange.nxs.nl The method 'generateHeaders' should actually eliminate the counter from the headernames. A more fancy solution would be using an array to store the Received headers (and any other header), instead of creating a new array-key. But I think it's up to the ezComponent-team to find the best way of solving this issue. Environment: Operating System: Debian GNU/Linux 4.0 Steps to Reproduce: When I fetch and parse an email with ezComponents, I'm able to access the headers with method 'generateHeaders' of class 'ezcMail'. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||