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

Message Issue #71

Closed
rfulcher opened this issue Mar 21, 2015 · 7 comments
Closed

Message Issue #71

rfulcher opened this issue Mar 21, 2015 · 7 comments
Labels
need help Your support is required to solve this issue. question This issue is about one or more questions regarding this library.

Comments

@rfulcher
Copy link

I have placed this code in a Codeigniter project. It has been working good but I have run across one issue that I am not sure how to fix. I have one message that is not HTML it is plain text and the body of the message is getting dropped. I would like to fix but I am not well versed in all the parameters and suck with mail & imap. But what is happening is Line 455 -> 489 pull the body and place it correctly in the $data variable.

After that line $459 shows as having an attachementid. Once it goes into there the $data is not assigned to anything to be returned. I see that lines 520 -> 527 is the only place that the $data is assigned to be returned.

I guess my question is, is there an error in the class or is there an error in the mail message? Should I place an assignment in lines 455 -> 489? Wondering why there is not one there now.

Thanks very much for your help.

@rfulcher
Copy link
Author

Also there is not an attachment on the email so really it should not be dropping into this if statement at 455.

@rfulcher
Copy link
Author

Ok more info. Below is what the message has

Content-Type: text/plain; charset="iso-8859-1"
Content-ID: A2ADC87DD7C6BF4C8D3E6C1A2F9E7B9A@wilson.edu
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

And the Content-ID is showing up as the attachementid and the ifid is set to 1. I can't figure out why that would be based on the message source.

Thanks

@barbushin barbushin added the question This issue is about one or more questions regarding this library. label May 6, 2015
@barbushin
Copy link
Owner

Hi. Could you please forward this mail to barbushin2@gmail.com?

@barbushin barbushin removed need help Your support is required to solve this issue. labels May 23, 2016
@erkens
Copy link

erkens commented Aug 2, 2016

The problem is an incorrect mailmessage. Basic example:

From: Michael <michael@example.com>
To: Test <test@example.com>
Subject: testmail
Date: Tue, 2 Aug 2016 07:00:00 +0000
Message-ID: <TEST123456ABC-3>
Content-Type: text/plain; charset="us-ascii"
Content-ID: <CONTENTID-BODY>
Content-Transfer-Encoding: quoted-printable

Sample content

With imap_fetchstructure you get:

  • type = TYPETEXT
  • ifid = true
  • id= ""

Because the "id" php-imap will handle the body as an attachment. Of course this is a bug in the client who send the mail, but when checking the type first (not multipart!) you can ignore the content-id and handle it as a normal body.

@barbushin barbushin added the need help Your support is required to solve this issue. label Aug 2, 2016
@commanddotcom
Copy link
Contributor

commanddotcom commented Jan 6, 2018

@erkens , so what is your thoughts on the best solution for multipart email? I've got this kind of emails from LinkedIn: both plain and html gets into attachment and body is NULL?

I don't think I understand why $partNum have to be 0. Are you sure about it?
image

@nickl-
Copy link
Contributor

nickl- commented Mar 29, 2019

related #39

@Sebbo94BY
Copy link
Collaborator

Fix has been merged.

Sebbo94BY added a commit that referenced this issue May 5, 2019
- Updated README
- Move phpunit to require-dev
- Add note about installing dev dependencies in README
- Replaced spaces with tabs
- Added PHPUnit tests for MIME decoding
- Updated formatting of PHPUnit function testParsedDateTimeWithEmptyHeaderDate()
- Issue #209: Function to parse datetime correctly RFC2822
- Issue #280: Added 'Sender' to headers and added additional if-conditions 
- Issue #115: getMail() method returns an object even for nonexistent mail ID
- Issue #273: Added connection check to example
- Issue #227: Added Failed-Recipients to IncomingMailHeader
- Issue #140, #246: Improved exception handling and added PHPUnit test
- Issue #140: Added PHPUnit test for testing ConnectionException
- Issue #140: Improved exception / error handling and improved / added PHPUnit tests
- Issue #154: Added ability to change the imap_search option from SE_UID to SE_FREE and added PHPUnit tests
- Issue #306: Added support for US-ASCII and added ability to disable serverEncoding for searchMailbox()
- Imported missing namespaces to avoid 'unknown class' error messages
- Issue #86: Simplified and improved one replace regex for attachment file names
- Issue #247: Improved grabbing of fromName, fromHost, senderName and senderHost
- Issue #39, #71, #229: Fixed body content gets incorrectly processed as attachments
- Issue #122, #150, #167: Added ability to skip processing of attachments to increase performance, when attachments are not required
- PR #284: Added missing PHPUnit tests
- Issue #122, #150, #167: Lazy load message text and attachments data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need help Your support is required to solve this issue. question This issue is about one or more questions regarding this library.
Projects
None yet
Development

No branches or pull requests

6 participants