6.0.0-git
2020-08-09

[#15026] BUG in Horde_Imap_Client : XML attachment is corrupted
Summary BUG in Horde_Imap_Client : XML attachment is corrupted
Queue Horde Framework Packages
Type Bug
State Feedback
Priority 1. Low
Owners
Requester kripper (at) imatronix (dot) cl
Created 2020-07-20 (20 days ago)
Due
Updated 2020-07-27 (13 days ago)
Assigned 2020-07-20 (20 days ago)
Resolved
Milestone
Patch No

History
2020-07-27 03:53:38 Michael Rubinsky Comment #5
Priority ⇒ 1. Low
Reply to this comment
Cannot reproduce this.

I imported the .eml file you sent me into my inbox and I can 
successfully parse the text/xml part, without any extraneous line 
breaks being inserted.

This is the quick bit of code I used to pull down the part, executed 
directly in Horde's admin phpshell:

<code>
// Get the Horde_Imap_Client object
$imap = $registry->mail->imapOb();

$mbox = new Horde_Imap_Client_Mailbox('INBOX');


// Fetch the message in question
$query = new Horde_Imap_Client_Fetch_Query();
$query->structure();
$query->envelope();
$query->headerText(array('peek' => true));

$results = $imap->fetch(
     $mbox,
     $query,
     array('ids' => new Horde_Imap_Client_Ids(array(436786)), 'exists' => true)
);

$message = $results[436786];

// Check out the mime part structure
$basePart = $message->getStructure();
foreach ($basePart->partIterator() as $part) {
   echo $part->getMimeId() . ': ' . $part->getType() . "\r\n";
}

// Get the part we want and decode it
$bpp = array(
   'decode' => true,
   'peek' => true);

$q = new Horde_Imap_Client_Fetch_Query();
$q->bodyPart(2, $bpp);
$q->mimeHeader(2, array('peek' => true));
$fetch_res = $imap->fetch(
   $mbox,
   $q,
   array('ids' => new Horde_Imap_Client_Ids(array(436786)))
);

// Output
echo $fetch_res[436786]->getBodyPart(2);
</code>


2020-07-20 18:20:40 kripper (at) imatronix (dot) cl Comment #4 Reply to this comment
Done. Thanks.
2020-07-20 18:15:45 Michael Rubinsky Comment #3
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
You can email any sensitive information to me directly at 
mrubinsk@horde.org.  If you'd like to encrypt it you can find my PGP 
key on keybase.io.  https://keybase.io/mrubinsk
2020-07-20 17:31:06 kripper (at) imatronix (dot) cl Comment #2 Reply to this comment
I would like to provide additional files with sensitive information, 
but this was not possible.
Please contact me via E-mail.
2020-07-20 17:08:25 kripper (at) imatronix (dot) cl Comment #1 (Private)
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ BUG in Horde_Imap_Client : XML attachment is corrupted
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
[Hidden]

Saved Queries