SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
268 stars 136 forks source link

Attachment: If the file type is Microsoft Office or TXT file it's not in attachments array #174

Closed usolved closed 7 years ago

usolved commented 7 years ago

Feature request or bug

Bug

If a bug, what did you expect to happen?

Attachments like Word or Text should be added to the attachments array

If a bug, what happened?

Other attachments like PDF, PNG, JPG, ... are stored perfectly in the attachments array so I can read the name and the body (even embeded images are stored perfectly as attachments).

But as soon as I attach (for example) a .docx file or .txt file to an eMail the attachments array stays empty and is only visible in other sections of the var_dump like info or parts (but not the data itself).

It might also occur with other types of files, but these are the two I've tested.

If a bug, list steps to reproduce bugs.

Just attach a Word or Text documents to an eMail. In this example I've attached a PNG file and a TXT file. PNG is working and TXT is not within the same eMail.

test_file_1.png = working test_file_2.txt = not working

Here's the dump with all information: https://pastebin.com/pLHmjKWG

mattparksjr commented 7 years ago

Hm.. It appears we dont support this yet. @sergey144010 can you help?

3zzy commented 7 years ago

Don't recognise CSV and ZIP either :(

sergey144010 commented 7 years ago

I'll think of something.

mattparksjr commented 7 years ago

@sergey144010 are you still working on this?

mattparksjr commented 7 years ago

@sergey144010 ping(Sorry lol ill get used to the code I promise)

dshinius commented 7 years ago

common guys there is nothing to think about. Just patch your code. No Acceptance to ZIP Attachments? Really?

The solution is to modify one line off accepted attachments types in the class TypeAttachments:

class TypeAttachments { /**

mattparksjr commented 7 years ago

If your mad about it, make a pull request. You forget no one here is payed... This is a side project for everyone. Make a pull request or ill edit it later...

SMH

dshinius commented 7 years ago

THX for your reply. I am not mad about it. Tried to help and identify the reason...

Am 2. September 2017 15:15:36 MESZ schrieb Matthew Parks notifications@github.com:

If your mad about it, make a pull request. You forget no one here is payed... This is a side project for everyone. Make a pull request or ill edit it later...

SMH

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/SSilence/php-imap-client/issues/174#issuecomment-326743434

-- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

cbielich commented 5 years ago

common guys there is nothing to think about. Just patch your code. No Acceptance to ZIP Attachments? Really?

The solution is to modify one line off accepted attachments types in the class TypeAttachments:

class TypeAttachments { /**

  • Types of attachments.
  • @var array */ private static $types = array('JPEG', 'PNG', 'GIF', 'PDF', 'X-MPEG', 'MSWORD', 'OCTET-STREAM');

    modify to whatever you want here

    private static $types = array('JPEG', 'PNG', 'GIF', 'PDF', 'X-MPEG', 'MSWORD', 'OCTET-STREAM', 'ZIP' , '...'); }

This does not work, I tried adding the Microsoft mime types and they are not working