[Tickets #15026] Re: BUG in Horde_Imap_Client : XML attachment is corrupted

noreply at bugs.horde.org noreply at bugs.horde.org
Mon Jul 27 03:53:39 UTC 2020


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/15026
------------------------------------------------------------------------------
  Ticket             | 15026
  Updated By         | Michael Rubinsky <mrubinsk at horde.org>
  Summary            | BUG in Horde_Imap_Client : XML attachment is corrupted
  Queue              | Horde Framework Packages
  Type               | Bug
  State              | Feedback
-Priority           | 2. Medium
+Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Michael Rubinsky <mrubinsk at horde.org> (2020-07-27 03:53) wrote:

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>







More information about the bugs mailing list