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

HTML / attachment problem with Apple Mail #164

Closed
launtony opened this Issue Oct 16, 2017 · 23 comments

Comments

Projects
None yet
3 participants
@launtony
Copy link

launtony commented Oct 16, 2017

I have a problem with Apple Mail. When the attachment is before the signature, the HTML after was not parsed into getMessageBody('html') :/

An idea please ? :)

Thanks a lot :p

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 16, 2017

Could you send the raw email to investigate ?

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 17, 2017

Thanks for your reply :)

mail-mime.txt

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 18, 2017

Thanks I understand the issue now, it's always the same problem with Apple Mail I don't know if this email is compliant to RFC.

What you have:

  • Headers
  • Part text
  • Multipart Mixed
    • Part Html (...)
    • Part Inline Attachment (pdf)
    • Part Html (...)

What this lib give you:

  • Headers
  • Part Text
  • Part Html (the first one)
  • Part Attachment

So there is no way to retrieve the second part Html but how I can do that this is 2 distinct Html part I can't construct one part with 2 html tag ???

I know and it worked in php-mime-mail-parser to inline attachment with content-id but I didn't know this way to do inline attachment. Could you find the RFC that said that ?

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 18, 2017

I understand :/ I will find the RFC if her exists :) But how to parse some emails in the same with the parser (some HTML replies) ?

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 18, 2017

I think in this case we have a multipart/message that can be an attachment and you can pass again to the parser to retrieve the information.
But it's a good question, I need to investigate this also.

There is always some improvements to do :)

@eXorus eXorus added the question label Oct 19, 2017

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 20, 2017

Do you have any news? :) I haven't found the Apple Mail RFC :/

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 20, 2017

Could you send this email to gmail and see what is going on ? how google print this email ?

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 20, 2017

It works with two HTML parts.

I have uploaded the raw (from gmail).

original_msg.txt

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 20, 2017

how google render this ?

we see the email with the 2 html part with the PDF between them or in attachment ?

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 20, 2017

I have all HTML parts and the PDF in the attachment section

@eXorus eXorus added enhancement and removed question labels Oct 20, 2017

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 20, 2017

Ok if it's working like this in gmail I will do the work.

Merge all html part in one part.
Could you give me the html you have in gmail ? is there 2 html tag or not ?

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 20, 2017

You have original_msg.txt on the previous messages. This is the gmail raw sources.

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 20, 2017

I don't want the raw source, I want to see how the html is render in gmail. So the source code of the email.
Go to gmail
Select the body of your email
Right click and show source code.

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 20, 2017

Sorry, I didn't understand :/ you can find the body

from Gmail source code.

email.html.txt

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 20, 2017

Are you sure of your selection ?

because I don't see "Ceci est un test" that is a sentence of the first html part
and I only see "easylia-130.png" that is in the second html part.

So gmail don't merge the 2 html parts it only show the second part.

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 20, 2017

It's not the same email :/ I'm sorry. In the attachment, it's the right source code.
email.html.txt

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 24, 2017

Do you have an idea? How gmail manage this case ?

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Oct 24, 2017

So I saw in the raw source is the 2 html parts merged together in one body.

Could you give me the screenshot of the email in gmail ? because you said earlier that gmail give you also the 2 html part in attachments.

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 24, 2017

You can found the screenshot here :)

screen shot 2017-10-24 at 17 27 52

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 24, 2017

The original email contain an attachment between "Ceci est un test" and the signature. Gmail put all attachments in the attachments area. This is a good job. But your lib get only "Ceci est un test" and the attachment not the signature. On the raw source you can you 2 HTML tag. One for "Ceci est un test" and the signature.

@dorianfm

This comment has been minimized.

Copy link
Contributor

dorianfm commented Oct 24, 2017

This seems to be somewhat related to #163 which I've posted.

@launtony

This comment has been minimized.

Copy link

launtony commented Oct 24, 2017

Yes I saw :/

@eXorus

This comment has been minimized.

Copy link
Member

eXorus commented Nov 2, 2017

So you can use getInlineParts() to merge the 2 html now in the 2.9.3

@eXorus eXorus closed this Nov 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment