Skip to content

Commit 829b2a1

Browse files
eidng8Webklex
authored andcommitted
support message delivery status (#47)
1 parent 1683aeb commit 829b2a1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/IMAP/Message.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ private function fetchStructure($structure, $partNumber = null) {
431431
*/
432432
protected function fetchAttachment($structure, $partNumber){
433433
switch ($structure->type) {
434+
case self::TYPE_MESSAGE:
435+
$type = 'message';
436+
break;
434437
case self::TYPE_APPLICATION:
435438
$type = 'application';
436439
break;
@@ -476,6 +479,13 @@ protected function fetchAttachment($structure, $partNumber){
476479
}
477480
}
478481
}
482+
if(self::TYPE_MESSAGE == $structure->type) {
483+
if($structure->ifdescription) {
484+
$attachment->name = $structure->description;
485+
} else {
486+
$attachment->name = $structure->subtype;
487+
}
488+
}
479489

480490
if (!$attachment->name && property_exists($structure, 'parameters')) {
481491
foreach ($structure->parameters as $parameter) {

0 commit comments

Comments
 (0)