Darrik Spaude | 4 Nov 20:20
Favicon

Parsing Plain Text with Plain Text Attachment

Hello,

I have a situation where a plain text attachment part is being received along with a plain text part. I want the plain text to be parsed as text by the collector and the plain text attachment to be saved as a file. However, with parse option parseTextAttachmentsAsFiles set to FALSE, I cannot get the plain text attachment (it is seen as ezcMailText and not ezcMailFile) and the attachment text is not available in the $mailPart object. There are other cases where a text attachment is actually given as plain text and so I can get that and save it as a file, but in this case the plain text attachment is really an attachment.

He re is the mail part in question:

object(ezcMailText)#17 (4) { ["headers":"ezcMailPart":private]=> object(ezcMailHeadersHolder)#18 (2) { ["lookup":"ezcMailHeadersHolder":private]=> array(4) { ["content-type"]=> string(12) "Content-Type" ["content-description"]=> string(19) "Content-Description" ["content-disposition"]=> string(19) "Content-Disposition" ["content-transfer-encoding"]=> string(25) "Content-Transfer-Encoding" } ["map":"ezcMailHeadersHolder":private]=> array(4) { ["Content-Type"]=> string(31) "text/plain; name="InboxLOG.txt"" ["Content-Description"]=> array(1) { [0]=> string(12) "InboxLOG.txt" } ["Content-Disposition"]=> string(150) "attachment; creation-date="Mon, 18 Oct 2010 13:47:42 GMT"; filename="InboxLOG.txt"; modification-date="Thu, 04 Nov 2010 10:48:30 GMT"; size="186282"" ["Content-Transfer-Encoding"]=> string(6) "base64" } } ["headerCharsets":"ezcMailPart":private]=> array(4) { ["Content-Type"]=> string(8) "us-ascii" ["Content-Description"]=> string(8) "us-ascii" ["Content-Disposition"]=> string(8) "us-ascii" ["Content-Transfer-Encoding"]=> string(8) "us-ascii" } ["excludeHeaders":"ezcMailPart":private]=> array(0) { } ["properties":protected]=> array(7) { ["text"]=> string(0) "" ["charset"]=> string(5) "utf-8" ["encoding"]=> string(4) "8bit" ["subType"]=> string(5) "plain" ["originalCharset"]=> string(8) "us-ascii" ["contentDisposition"]=> object(ezcMailContentDispositionHeader)#19 (11) { ["disposition"]=> string(10) "attachment" ["fileName"]=> string(12) "InboxLOG.txt" ["displayFileName"]=> string(12) "InboxLOG.txt" ["fileNameLanguage"]=> NULL ["fileNameCharSet"]=> NULL ["creationDate"]=> string(29) "Mon, 18 Oct 2010 13:47:42 GMT" ["modificationDate"]=> string(29) "Thu, 04 Nov 2010 10:48:30 GMT" ["readDate"]=> NULL ["size"]=> string(6) "186282" ["additionalParameters"]=> array(0) { } ["additionalParametersMetaData"]=> array(0) { } } ["size"]=> int(0) } }


Is there some way to re-parse just that part as ezcMailFile? I do not want to re-parse the whole set with parseTextAttachmentsAsFiles set to TRUE.

Thanks,
Darrik


Gmane