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

rfc822 (eml) with attachments not correct #25

Open
GoogleCodeExporter opened this issue May 22, 2015 · 1 comment
Open

rfc822 (eml) with attachments not correct #25

GoogleCodeExporter opened this issue May 22, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Parse a mail with EML-Attachments which contain attachments (e.g. pdf's)
2. getAttachments() returns the EMLs and the attachments are in these.

What is the expected output? What do you see instead?
Not sure, but when I parse a mail i would like to display only the actual level 
(EML-Attachments). but here you become EMLs and their attachments at the same 
"level".

it were very useful to fix this

Original issue reported on code.google.com by [email protected] on 31 Aug 2011 at 3:41

@GoogleCodeExporter
Copy link
Author

I found that emails sent by outlook had a number of issues with some tags [they 
had an extra newline].
Once I ran the following on the entire email string, everythingthings worked as 
expected (multipart messages, attachments, usw)

  $data = preg_replace ('/;\s*$\s*(boundary|charset|filename|name)\s*=\s*"([^"]+)"/ims',';\1="\2"', $data);

[NOTE: this regex expects the values to be quoted]

For example,

Content-Type: multipart/alternative;
    boundary="----=_NextPart_000_001C_01CC9ED8.68F2D110"
...
Content-Type: text/plain;
    charset="us-ascii"

is changed to:

Content-Type: 
multipart/alternative;boundary="----=_NextPart_000_001C_01CC9ED8.68F2D110"
...
Content-Type: text/plain;charset="us-ascii"

John GIllespie

Original comment by [email protected] on 23 Nov 2011 at 7:27

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

No branches or pull requests

1 participant