Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Pop3.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public function getEmails($start = 0, $range = 10)
->test(2, 'int');

$total = $this->getEmailTotal();
$total = $total['messages'];

if ($total == 0) {
return array();
Expand Down Expand Up @@ -316,6 +317,7 @@ public function remove($msgno)

foreach ($msgno as $number) {
$this->call('DELE '.$number);

}

return $this;
Expand Down Expand Up @@ -661,12 +663,15 @@ private function getParts($content, array $parts = array())
{
//separate the head and the body
list($head, $body) = preg_split("/\n\s*\n/", $content, 2);
//front()->output($head);
//get the headers
$head = $this->getHeaders($head);
//if content type is not set
if (!isset($head['content-type'])) {
return $parts;
}



//split the content type
if (is_array($head['content-type'])) {
Expand Down Expand Up @@ -694,7 +699,7 @@ private function getParts($content, array $parts = array())
$attr = explode('=', $attr, 2);
if (count($attr) > 1) {
list($key, $value) = $attr;
$extra[strtolower($key)] = $value;
$extra[$key] = $value;
}
unset($extra[$i]);
}
Expand Down Expand Up @@ -739,11 +744,18 @@ private function getParts($content, array $parts = array())
if (isset($extra['name'])) {
//add to parts
$parts['attachment'][$extra['name']][$type] = $body;

/* To show embedded image we need CID and that comes with this x-attachment-id, require specially for gmail. */
if (isset($head['x-attachment-id']))
$parts['attachment'][$extra['name']]['x-attachment-id'] = $head['x-attachment-id'];

} else {
//it's just a regular body
//add to parts
$parts[$type] = $body;
}


}
return $parts;
}
Expand Down