Skip to content

Can't fetch some attachments #150

Closed
Closed
@EthraZa

Description

@EthraZa

I'm unable to fetch attachment from some senders messages.

It's maybe related to #142

An eml sample with this problem:
CantGetAttachment.eml.txt

And here is the output of var_dump($message->getAttachments()):
CantGetAttachment.log.txt

As it can be seen on log at line 938, looks like it's getting the XML attachment and the body together:

       ["structure":protected]=>
        object(Webklex\PHPIMAP\Structure)#255 (5) {
          ["raw"]=>
          string(13973) "----AaZz
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline

Segue, em anexo, em caráter meramente comercial, o arquivo da nota fiscal eletrônica 2798556, de 11/08/2021 com chave de acesso 33210834274233009584550000027985561873768020.
Informamos que, independente deste envio, o arquivo da mesma ficará à disposição, para download, na aplicação Canal de Negócios do Portal BR, no endereço www.br.com.br.

----AaZz
Content-Type: application/xml; charset="UTF-8";
	name="NF-e_33210834274233009584550000027985561873768020.xml"
Content-Disposition: attachment;
	filename="NF-e_33210834274233009584550000027985561873768020.xml"
Content-Transfer-Encoding: base64

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PG5m
ZVByb2MgeG1sbnM9Imh0dHA6Ly93d3cucG9ydGFsZmlzY2FsLmluZi5ici9uZmUiIHZlcnNhbz0i
...

Versions:

$ php -v
PHP 8.0.9 (cli) (built: Jul 31 2021 08:10:26) ( NTS )

$ grep -A1 php-imap composer.lock 
            "name": "webklex/php-imap",
            "version": "2.5.1",

There's something I can do to get it working right?
Or, could you please point me to the file or method that could be tweked?
(This code is in production and will explode on me soon!)

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions