Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional attachment with undefined name #37

Closed
fadedshadowx opened this issue Oct 27, 2020 · 2 comments
Closed

additional attachment with undefined name #37

fadedshadowx opened this issue Oct 27, 2020 · 2 comments
Labels
bug Something isn't working validated

Comments

@fadedshadowx
Copy link

fadedshadowx commented Oct 27, 2020

When I am trying decode attachment with:

$message->getAttachments();

I always have additional object in item array:

0 => Webklex\PHPIMAP\Attachment {#682 ▼
      #oMessage: Webklex\PHPIMAP\Message {#664 ▶}
      #config: array:9 [▶]
      #part: Webklex\PHPIMAP\Part {#674 ▶}
      #attributes: array:9 [▼
        "content" => ""
        "type" => "text"
        "part_number" => 0
        "content_type" => null
        "id" => null
        "name" => "undefined"
        "disposition" => null
        "img_src" => null
        "size" => 0
      ]
      #mask: "Webklex\PHPIMAP\Support\Masks\AttachmentMask"
    }

why it's showing? It's showing only one time for every message with any count attachments.

@Webklex
Copy link
Owner

Webklex commented Oct 27, 2020

Hi @Damian-G ,
thanks for your report. Please add some additional detail such as:

  • Used webklex/php-imap version
  • Used protocol
  • Code example / how do you interact with it?

Best regards,

@fadedshadowx
Copy link
Author

"webklex/php-imap": "^2.2",
php 7.4.11
debian 9.13

my code:

$client = ImapClient::account('default');
$client->setDefaultMessageMask(MessageMask::class);
$client->connect();
$folder = $client->getFolder('INBOX');
$messages = $folder->messages()->all()->get();
foreach($messages as $message){
dd($message->getAttachments());
}

reply:

#items: array:3 [▼
   0 => Webklex\PHPIMAP\Attachment {#686 ▼
     #oMessage: Webklex\PHPIMAP\Message {#668 ▶}
     #config: array:9 [▶]
     #part: Webklex\PHPIMAP\Part {#678 ▶}
     #attributes: array:9 [▼
       "content" => ""
       "type" => "text"
       "part_number" => 0
       "content_type" => null
       "id" => null
       "name" => "undefined"
       "disposition" => null
       "img_src" => null
       "size" => 0
     ]
     #mask: "Webklex\PHPIMAP\Support\Masks\AttachmentMask"
   }
   1 => Webklex\PHPIMAP\Attachment {#687 ▶}
   2 => Webklex\PHPIMAP\Attachment {#688 ▶}

message has 2 attachments, expected is array with 2 items, not 3 as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validated
Projects
None yet
Development

No branches or pull requests

2 participants