SSilence / php-imap-client

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

Certain types of attachments do not show up #213

Open jmallory927 opened 6 years ago

jmallory927 commented 6 years ago

Feature request or bug

Bug

If a bug, what did you expect to happen?

Attachment to show up

If a bug, what happened?

When I dumped messages that had CSV attachments, some of them showed having an attachment correctly, others that were attached different, did not.

If a bug, list steps to reproduce bugs.

I have included two examples of the attachment header, one that does work, and one that does not work. This is the one that, and the attachment encoding looks like this:

Content-Type: multipart/mixed; boundary="===============5829732510131949236==" MIME-Version: 1.0 Subject: Sales Summary Daily Report for XXXXXXX From: XXXX noreply@XXXXXXX.com To: XXXXX@XXXXXXX.XXX, XXXXXX@XXXXXXXXX.XXX Date: Fri, 23 Mar 2018 13:13:48 -0000 Message-ID: 20180323131348.16746.16605@XXXX.XXXX.XXXXXXX.com X-XXXXX-Instance: XXXXXXX X-XXXXX-Email: yes

--===============5829732510131949236== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit

See daily report for XXXXXXXXXXXX in attachment.

--===============5829732510131949236== Content-Type: application/octet-stream MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Sales_Summary_Daily_Report_XXXXXXXXXXXXXX_2018-03-22_2018-03-23.csv"

VGltZSBUbyxUaW1lIEZyb20sSG91c2UgQWNjb3VudCBQYXlhYmxlLEhvdXNlIEFjY291bnQgUmVj ZWl2YWJsZSxHaWZ0IFNhbGVzIFBheWFibGUsR2lmdCBTYWxlcyBSZWNlaXZhYmxlLFN0b3JlIENy ZWRpdCBTYWxlcyBQYXlhYmxlLFN0b3JlIENyZWRpdCBTYWxlcyBSZWNlaXZhYmxlLExpYSBEZXBv

The one that fails is:

Subject: XXXXXXXXX Daily Labor CSV for 03/22 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="--==_mimepart_5ab4c80650c29_4cd62af9d283f32816a1"; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SG-EID: ywksbvxoql+YBY3OifvYEo3Jy2Yg+1XmHjSX5CFU7XIQaIARgKtOe+sDeD0SLYP1zOAqAOFcxD9Q24 xb5bfgGvenAm/8aUG8bTjEf3qljVyAymIEw63EAN2o/25W5/qX3qCgCqm3geAT59wQzQ1w73gI4S7M j8f1HMkqlr3Z6rdroKHXxxjKhT9MNctDa08Ouks4kDLdDlpT0JOjXuVywb7OZfLXAM4iYbaA5x1A/4 w= X-MAG-PROFILE: XXXXXX@XXXXXXX.XXX X-MAG-CATEGORY: SENDER X-MAG-FILTER: sender X-MAG-INFO: support@XXXXXXX.XXX X-MAG-ACTION: ACCEPT

----==_mimepart_5ab4c80650c29_4cd62af9d283f32816a1 Date: Fri, 23 Mar 2018 09:25:26 +0000 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5ab4c8064ff6c_4cd62af9d283f32815e0"; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: 5ab4c806561b3_4cd62af9d283f3281942@ac6952ef019c.mail

----==_mimepart_5ab4c8064ff6c_4cd62af9d283f32815e0 Date: Fri, 23 Mar 2018 09:25:26 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: 5ab4c80653d1c_4cd62af9d283f3281754@ac6952ef019c.mail

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

We've attached your daily labor report spreadsheet to this e-mail. If you have any questions, you may reply directly to this e-mail. Thanks for subscribing!


To unsubscribe from receiving this Labor Report, please click here.

----==_mimepart_5ab4c8064ff6c_4cd62af9d283f32815e0 Date: Fri, 23 Mar 2018 09:25:26 +0000 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: 5ab4c80655b71_4cd62af9d283f328180@ac6952ef019c.mail

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

We've attached your daily labor report spreadsheet to this e-mail. If you have any questions, you may reply directly to this e-mail. Thanks for subscribing!


To unsubscribe from receiving this Labor Report, please click here.

----==_mimepart_5ab4c8064ff6c_4cd62af9d283f32815e0--

----==_mimepart_5ab4c80650c29_4cd62af9d283f32816a1 Date: Fri, 23 Mar 2018 09:25:26 +0000 Mime-Version: 1.0 Content-Type: text/csv; charset=UTF-8; filename=labor-report--2018-03-22-to-2018-03-22--XXXXXXXXX.csv Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=labor-report--2018-03-22-to-2018-03-22--XXXXXX.csv Content-ID: 5ab4c8063b9f9_4cd62af9d283f32814cc@ac6952ef019c.mail

Labor Report - XXXXXXXXXX 03-22-2018 to 03-22-2018

Employee Totals Employee ID,Last Name,First Name,Role,Reg Hrs,1.5x Hrs,PayPerHour,Total Pay,Net Sales,Auto Grat,Cash Tips,Credit Tips,Tender Tips,Total Tips,Declared Tips "XXXXXXXX","XXXX","XXXXX","Employee",2.73,0,7.25,19.79,0,0,0,0,0,0,0

On another system, I use this older version:

Using that version, I can connect and it does see the attachment. The three problems are, I can't use that system to do this, that version does not work on the system that I need to do this, and I can change how those files are attached.

I would have attached the two emails in my example, but they have personal identifiable information in the attachments, so I can not publish those. If you want to see the attachments, I can send them to someone, I just cant publish them on github.

If a bug, did you do these steps?

[X] Download and use the lastest stable version [X] See if the issue has already been reported [] Debug

If a feature request, what do you want to be added or changed?

If a feature request, is this feature already in a pull request?

If a feature request, do you know anyone who can help?

Side notes(Read then del this chunk)

Please use pastebin for var_dumps. Not screenies or paste blobs!
Be descriptive!
Please fill out this entire form!

mattparksjr commented 6 years ago

Hello! We are aware of this issue. 1) Please use pastebin or other related services for large dumps 2) I am working on dynamic attachment types. However the person who did the recode is no longer with us and I must learn the code