diff --git a/composer.json b/composer.json index 311a347e..565735cb 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "webklex/php-imap", + "name": "smartilabs/php-imap", "type": "library", "description": "PHP IMAP client", "keywords": [ diff --git a/src/Header.php b/src/Header.php index 8134ca3a..df1032cc 100644 --- a/src/Header.php +++ b/src/Header.php @@ -147,6 +147,8 @@ protected function parse(){ } if (property_exists($header, 'message_id')) { $this->attributes["message_id"] = str_replace(['<', '>'], '', $header->message_id); + } else if (property_exists($header, 'message-id')) { + $this->attributes["message_id"] = str_replace(['<', '>'], '', $header->{'message-id'}); } $this->parseDate($header); diff --git a/src/Part.php b/src/Part.php index d67c6850..f4356304 100644 --- a/src/Part.php +++ b/src/Part.php @@ -299,7 +299,7 @@ private function parseEncoding(){ * @return bool */ public function isAttachment(){ - if ($this->type == IMAP::MESSAGE_TYPE_TEXT && ($this->ifdisposition == 0 || (empty($this->disposition) || !in_array(strtolower($this->disposition), ['attachment', 'inline'])) ) ) { + if ($this->type == IMAP::MESSAGE_TYPE_TEXT && ($this->ifdisposition == 0 || (empty($this->disposition) || !in_array(strtolower($this->disposition), ['attachment'])) ) ) { if (($this->subtype == null || in_array((strtolower($this->subtype)), ["plain", "csv", "html"])) && $this->filename == null && $this->name == null) { return false; } diff --git a/src/Structure.php b/src/Structure.php index 1b12b80c..c4875d17 100644 --- a/src/Structure.php +++ b/src/Structure.php @@ -100,7 +100,7 @@ public function findContentType(){ * Determine the message content type */ public function getBoundary(){ - $boundary = $this->header->find("/boundary\=\"?(.*)\"?/"); + $boundary = $this->header->find("/boundary\=\"?(.*?)[\";\s]/"); return str_replace('"', '', $boundary); }